1 |
commit: 99e2cbb94d89961cadf4aade5d8757279fc374e0 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 25 19:50:52 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 1 20:51:51 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=99e2cbb9 |
7 |
|
8 |
dodoc: call doins, to reuse recursion code |
9 |
|
10 |
This will fix broken recursion logic for bug #356461. |
11 |
|
12 |
--- |
13 |
bin/ebuild-helpers/4/dodoc | 51 +------------------------------------------- |
14 |
bin/ebuild-helpers/doins | 13 ++++++++++- |
15 |
2 files changed, 13 insertions(+), 51 deletions(-) |
16 |
|
17 |
diff --git a/bin/ebuild-helpers/4/dodoc b/bin/ebuild-helpers/4/dodoc |
18 |
deleted file mode 100755 |
19 |
index 617bae2..0000000 |
20 |
--- a/bin/ebuild-helpers/4/dodoc |
21 |
+++ /dev/null |
22 |
@@ -1,50 +0,0 @@ |
23 |
-#!/bin/bash |
24 |
-# Copyright 1999-2010 Gentoo Foundation |
25 |
-# Distributed under the terms of the GNU General Public License v2 |
26 |
- |
27 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
28 |
- |
29 |
-if [ $# -lt 1 ] ; then |
30 |
- die "${0##*/}: at least one argument needed" |
31 |
- exit 1 |
32 |
-fi |
33 |
- |
34 |
-dir="${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" |
35 |
-if [ ! -d "${dir}" ] ; then |
36 |
- install -d "${dir}" |
37 |
-fi |
38 |
- |
39 |
-ret=0 |
40 |
- |
41 |
-DOINSRECUR="n" |
42 |
- |
43 |
-if [[ "$1" == "-r" ]] ; then |
44 |
- DOINSRECUR="y" |
45 |
- shift |
46 |
-fi |
47 |
- |
48 |
-for x in "$@" ; do |
49 |
- |
50 |
- if [ -d "${x}" ] ; then |
51 |
- if [[ ${DOINSRECUR} == "n" ]] ; then |
52 |
- echo "!!! ${0##*/}: $x is a directory" 1>&2 |
53 |
- ((ret|=1)) |
54 |
- continue |
55 |
- fi |
56 |
- |
57 |
- find "${x}" -mindepth 1 -maxdepth 1 -exec \ |
58 |
- env \ |
59 |
- _E_DOCDESTTREE_="$(basename "${x}")" \ |
60 |
- "${0}" -r {} \; |
61 |
- |
62 |
- elif [ -s "${x}" ] ; then |
63 |
- install -m0644 "${x}" "${dir}" || ((ret|=1)) |
64 |
- elif [ ! -e "${x}" ] ; then |
65 |
- echo "!!! ${0##*/}: $x does not exist" 1>&2 |
66 |
- ((ret|=1)) |
67 |
- fi |
68 |
- |
69 |
-done |
70 |
- |
71 |
-[[ $ret -ne 0 ]] && die "${0##*/} failed" |
72 |
-exit ${ret} |
73 |
|
74 |
diff --git a/bin/ebuild-helpers/4/dodoc b/bin/ebuild-helpers/4/dodoc |
75 |
new file mode 120000 |
76 |
index 0000000..35080ad |
77 |
--- /dev/null |
78 |
+++ b/bin/ebuild-helpers/4/dodoc |
79 |
@@ -0,0 +1 @@ |
80 |
+../doins |
81 |
\ No newline at end of file |
82 |
|
83 |
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins |
84 |
index 51cac06..8055a37 100755 |
85 |
--- a/bin/ebuild-helpers/doins |
86 |
+++ b/bin/ebuild-helpers/doins |
87 |
@@ -1,5 +1,5 @@ |
88 |
#!/bin/bash |
89 |
-# Copyright 1999-2010 Gentoo Foundation |
90 |
+# Copyright 1999-2011 Gentoo Foundation |
91 |
# Distributed under the terms of the GNU General Public License v2 |
92 |
|
93 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
94 |
@@ -16,6 +16,17 @@ else |
95 |
DOINSRECUR=n |
96 |
fi |
97 |
|
98 |
+if [[ ${0##*/} == dodoc ]] ; then |
99 |
+ if [ $# -eq 0 ] ; then |
100 |
+ # default_src_install may call dodoc with no arguments |
101 |
+ # when DOC is defined but empty, so simply return |
102 |
+ # sucessfully in this case. |
103 |
+ exit 0 |
104 |
+ fi |
105 |
+ export INSOPTIONS=-m0644 |
106 |
+ export INSDESTTREE=usr/share/doc/${PF}/${_E_DOCDESTTREE_} |
107 |
+fi |
108 |
+ |
109 |
if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then |
110 |
vecho "-------------------------------------------------------" 1>&2 |
111 |
vecho "You should not use \${D} with helpers." 1>&2 |