Lines 3-21
Link Here
|
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 |
# $Header: /home/cvsroot/gentoo-src/portage/bin/dodoc,v 1.3 2002/11/23 19:21:58 vapier Exp $ |
4 |
# $Header: /home/cvsroot/gentoo-src/portage/bin/dodoc,v 1.3 2002/11/23 19:21:58 vapier Exp $ |
5 |
|
5 |
|
6 |
for x in "$@" ; do |
6 |
docinto() { |
7 |
if [ -e "${x}" ] ; then |
7 |
if [ $1 = "/" ]; then |
8 |
if [ ! -d "${D}usr/share/doc/${PF}" ] ; then |
8 |
DOCDESTTREE="" |
9 |
install -d "${D}usr/share/doc/${PF}" |
9 |
else |
|
|
10 |
DOCDESTTREE=$1 |
11 |
if [ ! -d ${D}usr/share/doc/${PF}/${DOCDESTTREE} ]; then |
12 |
install -d ${D}usr/share/doc/${PF}/${DOCDESTTREE} |
10 |
fi |
13 |
fi |
11 |
if [ -z "${DOCDESTTREE}" ] ; then |
14 |
fi |
12 |
install -m0644 "${x}" "${D}usr/share/doc/${PF}" |
15 |
} |
13 |
gzip -f -9 "${D}usr/share/doc/${PF}/${x##*/}" |
16 |
|
|
|
17 |
installdoc() { |
18 |
desttree="${DOCDESTTREE:+${DOCDESTTREE}/}" |
19 |
if [ -e "${1}" ] ; then |
20 |
if [ ! -d "${D}usr/share/doc/${PF}/${desttree}" ] ; then |
21 |
install -d "${D}usr/share/doc/${PF}/${desttree}" |
22 |
fi |
23 |
if [ -d "${1}" ]; then |
24 |
savetree="${desttree}" |
25 |
docinto "${origdesttree}${1}" |
26 |
find "${1}" -mindepth 1 -maxdepth 1 | while read y; do |
27 |
installdoc "${y}" |
28 |
done |
29 |
docinto "${savetree}" |
14 |
else |
30 |
else |
15 |
install -m0644 "${x}" "${D}usr/share/doc/${PF}/${DOCDESTTREE}" |
31 |
install -m0644 "${1}" "${D}usr/share/doc/${PF}/${desttree}" |
16 |
gzip -f -9 "${D}usr/share/doc/${PF}/${DOCDESTTREE}/${x##*/}" |
32 |
if [ -z "$DOCNOCOMPRESS" ]; then |
|
|
33 |
gzip -f -9 "${D}usr/share/doc/${PF}/${desttree}${1##*/}" |
34 |
fi |
17 |
fi |
35 |
fi |
18 |
else |
36 |
else |
19 |
echo "${0}: ${x} does not exist." |
37 |
echo "${0}: ${1} does not exist." |
20 |
fi |
38 |
fi |
|
|
39 |
} |
40 |
|
41 |
for x in "$@" ; do |
42 |
origdesttree="${DOCDESTTREE:+${DOCDESTTREE}/}" |
43 |
installdoc "${x}" |
21 |
done |
44 |
done |