Lines 1-10
Link Here
|
1 |
#!/bin/bash |
1 |
#!/bin/bash |
2 |
# Copyright 1999-2007 Gentoo Foundation |
2 |
# Copyright 1999-2009 Gentoo Foundation |
3 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# Distributed under the terms of the GNU General Public License v2 |
4 |
# $Id$ |
4 |
# $Id$ |
5 |
|
5 |
|
|
|
6 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
7 |
|
6 |
if [ $# -lt 1 ] ; then |
8 |
if [ $# -lt 1 ] ; then |
7 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
|
|
8 |
vecho "${0##*/}: at least one argument needed" 1>&2 |
9 |
vecho "${0##*/}: at least one argument needed" 1>&2 |
9 |
exit 1 |
10 |
exit 1 |
10 |
fi |
11 |
fi |
Lines 15-28
Link Here
|
15 |
fi |
16 |
fi |
16 |
|
17 |
|
17 |
ret=0 |
18 |
ret=0 |
18 |
for x in "$@" ; do |
19 |
|
19 |
if [ -s "${x}" ] ; then |
20 |
if hasq "${EAPI:-0}" 0 1 ; then |
20 |
install -m0644 "${x}" "${dir}" |
21 |
|
21 |
ecompress --queue "${dir}/${x##*/}" |
22 |
for x in "$@" ; do |
22 |
elif [ ! -e "${x}" ] ; then |
23 |
if [ -s "${x}" ] ; then |
23 |
echo "!!! ${0##*/}: $x does not exist" 1>&2 |
24 |
install -m0644 "${x}" "${dir}" |
24 |
((++ret)) |
25 |
ecompress --queue "${dir}/${x##*/}" |
|
|
26 |
elif [ ! -e "${x}" ] ; then |
27 |
echo "!!! ${0##*/}: $x does not exist" 1>&2 |
28 |
((++ret)) |
29 |
fi |
30 |
done |
31 |
|
32 |
else |
33 |
|
34 |
if [[ "$1" == "-r" ]] ; then |
35 |
DOINSRECUR=y |
36 |
shift |
37 |
else |
38 |
DOINSRECUR=n |
25 |
fi |
39 |
fi |
26 |
done |
|
|
27 |
|
40 |
|
|
|
41 |
for x in "$@" ; do |
42 |
|
43 |
if [ -d "${x}" ] ; then |
44 |
if [[ ${DOINSRECUR} == "n" ]] ; then |
45 |
continue |
46 |
fi |
47 |
|
48 |
find "${x}" -mindepth 1 -maxdepth 1 -exec \ |
49 |
env \ |
50 |
_E_DOCDESTTREE_="$(basename \"${x}\")" \ |
51 |
${0} -r {} \; |
52 |
|
53 |
elif [ -s "${x}" ] ; then |
54 |
install -m0644 "${x}" "${dir}" |
55 |
ecompress --queue "${dir}/${x##*/}" |
56 |
|
57 |
elif [ ! -e "${x}" ] ; then |
58 |
echo "!!! ${0##*/}: $x does not exist" 1>&2 |
59 |
((++ret)) |
60 |
fi |
61 |
|
62 |
done |
63 |
|
64 |
fi |
65 |
|
28 |
exit ${ret} |
66 |
exit ${ret} |
|
|
67 |
|