1 |
commit: ca755a56b628c8296630c3e435425b14d3b8bf10 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 1 22:42:45 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Sep 1 22:42:45 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca755a56 |
7 |
|
8 |
Eliminate bin/ebuild-helpers/4 directory. |
9 |
|
10 |
Instead, just use conditionals where appropriate inside |
11 |
bin/ebuild-helpers/* scripts. |
12 |
|
13 |
--- |
14 |
bin/banned-helper | 6 ------ |
15 |
bin/ebuild-helpers/4/dodoc | 1 - |
16 |
bin/ebuild-helpers/4/dohard | 1 - |
17 |
bin/ebuild-helpers/4/dosed | 1 - |
18 |
bin/ebuild-helpers/4/prepalldocs | 1 - |
19 |
bin/ebuild-helpers/dodoc | 13 ++++++++++++- |
20 |
bin/ebuild-helpers/dohard | 11 ++++++++++- |
21 |
bin/ebuild-helpers/doins | 16 +++++++++------- |
22 |
bin/ebuild-helpers/dosed | 11 ++++++++++- |
23 |
bin/ebuild-helpers/prepalldocs | 11 ++++++++++- |
24 |
bin/phase-functions.sh | 2 +- |
25 |
.../package/ebuild/_config/special_env_vars.py | 1 + |
26 |
pym/portage/package/ebuild/doebuild.py | 3 --- |
27 |
13 files changed, 53 insertions(+), 25 deletions(-) |
28 |
|
29 |
diff --git a/bin/banned-helper b/bin/banned-helper |
30 |
deleted file mode 100755 |
31 |
index 17ea991..0000000 |
32 |
--- a/bin/banned-helper |
33 |
+++ /dev/null |
34 |
@@ -1,6 +0,0 @@ |
35 |
-#!/bin/bash |
36 |
-# Copyright 2009 Gentoo Foundation |
37 |
-# Distributed under the terms of the GNU General Public License v2 |
38 |
- |
39 |
-die "'${0##*/}' has been banned for EAPI '$EAPI'" |
40 |
-exit 1 |
41 |
|
42 |
diff --git a/bin/ebuild-helpers/4/dodoc b/bin/ebuild-helpers/4/dodoc |
43 |
deleted file mode 120000 |
44 |
index 35080ad..0000000 |
45 |
--- a/bin/ebuild-helpers/4/dodoc |
46 |
+++ /dev/null |
47 |
@@ -1 +0,0 @@ |
48 |
-../doins |
49 |
\ No newline at end of file |
50 |
|
51 |
diff --git a/bin/ebuild-helpers/4/dohard b/bin/ebuild-helpers/4/dohard |
52 |
deleted file mode 120000 |
53 |
index 1a6b57a..0000000 |
54 |
--- a/bin/ebuild-helpers/4/dohard |
55 |
+++ /dev/null |
56 |
@@ -1 +0,0 @@ |
57 |
-../../banned-helper |
58 |
\ No newline at end of file |
59 |
|
60 |
diff --git a/bin/ebuild-helpers/4/dosed b/bin/ebuild-helpers/4/dosed |
61 |
deleted file mode 120000 |
62 |
index 1a6b57a..0000000 |
63 |
--- a/bin/ebuild-helpers/4/dosed |
64 |
+++ /dev/null |
65 |
@@ -1 +0,0 @@ |
66 |
-../../banned-helper |
67 |
\ No newline at end of file |
68 |
|
69 |
diff --git a/bin/ebuild-helpers/4/prepalldocs b/bin/ebuild-helpers/4/prepalldocs |
70 |
deleted file mode 120000 |
71 |
index 1a6b57a..0000000 |
72 |
--- a/bin/ebuild-helpers/4/prepalldocs |
73 |
+++ /dev/null |
74 |
@@ -1 +0,0 @@ |
75 |
-../../banned-helper |
76 |
\ No newline at end of file |
77 |
|
78 |
diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc |
79 |
index 1f333a6..d6ce679 100755 |
80 |
--- a/bin/ebuild-helpers/dodoc |
81 |
+++ b/bin/ebuild-helpers/dodoc |
82 |
@@ -1,7 +1,18 @@ |
83 |
#!/bin/bash |
84 |
-# Copyright 1999-2011 Gentoo Foundation |
85 |
+# Copyright 1999-2012 Gentoo Foundation |
86 |
# Distributed under the terms of the GNU General Public License v2 |
87 |
|
88 |
+case "${EAPI}" in |
89 |
+ 0|1|2|3) |
90 |
+ ;; |
91 |
+ *) |
92 |
+ exec \ |
93 |
+ env \ |
94 |
+ __PORTAGE_HELPER="dodoc" \ |
95 |
+ doins "$@" |
96 |
+ ;; |
97 |
+esac |
98 |
+ |
99 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
100 |
|
101 |
if [ $# -lt 1 ] ; then |
102 |
|
103 |
diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard |
104 |
index b52fd7c..6ae93d2 100755 |
105 |
--- a/bin/ebuild-helpers/dohard |
106 |
+++ b/bin/ebuild-helpers/dohard |
107 |
@@ -1,7 +1,16 @@ |
108 |
#!/bin/bash |
109 |
-# Copyright 1999-2011 Gentoo Foundation |
110 |
+# Copyright 1999-2012 Gentoo Foundation |
111 |
# Distributed under the terms of the GNU General Public License v2 |
112 |
|
113 |
+case "${EAPI}" in |
114 |
+ 0|1|2|3) |
115 |
+ ;; |
116 |
+ *) |
117 |
+ die "'${0##*/}' has been banned for EAPI '$EAPI'" |
118 |
+ exit 1 |
119 |
+ ;; |
120 |
+esac |
121 |
+ |
122 |
if [[ $# -ne 2 ]] ; then |
123 |
echo "$0: two arguments needed" 1>&2 |
124 |
exit 1 |
125 |
|
126 |
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins |
127 |
index fd77934..26b11a8 100755 |
128 |
--- a/bin/ebuild-helpers/doins |
129 |
+++ b/bin/ebuild-helpers/doins |
130 |
@@ -4,7 +4,9 @@ |
131 |
|
132 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
133 |
|
134 |
-if [[ ${0##*/} == dodoc ]] ; then |
135 |
+helper=${__PORTAGE_HELPER:-${0##*/}} |
136 |
+ |
137 |
+if [[ ${helper} == dodoc ]] ; then |
138 |
if [ $# -eq 0 ] ; then |
139 |
# default_src_install may call dodoc with no arguments |
140 |
# when DOC is defined but empty, so simply return |
141 |
@@ -16,7 +18,7 @@ if [[ ${0##*/} == dodoc ]] ; then |
142 |
fi |
143 |
|
144 |
if [ $# -lt 1 ] ; then |
145 |
- helpers_die "${0##*/}: at least one argument needed" |
146 |
+ helpers_die "${helper}: at least one argument needed" |
147 |
exit 1 |
148 |
fi |
149 |
|
150 |
@@ -35,7 +37,7 @@ if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then |
151 |
vecho "You should not use \${D} or \${ED} with helpers." 1>&2 |
152 |
vecho " --> ${INSDESTTREE}" 1>&2 |
153 |
vecho "-------------------------------------------------------" 1>&2 |
154 |
- helpers_die "${0##*/} used with \${D} or \${ED}" |
155 |
+ helpers_die "${helper} used with \${D} or \${ED}" |
156 |
exit 1 |
157 |
fi |
158 |
|
159 |
@@ -79,7 +81,7 @@ _doins() { |
160 |
install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}" |
161 |
rval=$? |
162 |
[[ -n ${cleanup} ]] && rm -f "${cleanup}" |
163 |
- [ $rval -ne 0 ] && echo "!!! ${0##*/}: $mysrc does not exist" 1>&2 |
164 |
+ [ $rval -ne 0 ] && echo "!!! ${helper}: $mysrc does not exist" 1>&2 |
165 |
return $rval |
166 |
} |
167 |
|
168 |
@@ -99,8 +101,8 @@ for x in "$@" ; do |
169 |
if [[ $PRESERVE_SYMLINKS = n && -d $x ]] || \ |
170 |
[[ $PRESERVE_SYMLINKS = y && -d $x && ! -L $x ]] ; then |
171 |
if [ "${DOINSRECUR}" == "n" ] ; then |
172 |
- if [[ ${0##*/} == dodoc ]] ; then |
173 |
- echo "!!! ${0##*/}: $x is a directory" 1>&2 |
174 |
+ if [[ ${helper} == dodoc ]] ; then |
175 |
+ echo "!!! ${helper}: $x is a directory" 1>&2 |
176 |
((failed|=1)) |
177 |
fi |
178 |
continue |
179 |
@@ -155,4 +157,4 @@ for x in "$@" ; do |
180 |
fi |
181 |
done |
182 |
rm -rf "$TMP" |
183 |
-[[ $failed -ne 0 || $success -eq 0 ]] && { helpers_die "${0##*/} failed"; exit 1; } || exit 0 |
184 |
+[[ $failed -ne 0 || $success -eq 0 ]] && { helpers_die "${helper} failed"; exit 1; } || exit 0 |
185 |
|
186 |
diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed |
187 |
index f202df7..24ec205 100755 |
188 |
--- a/bin/ebuild-helpers/dosed |
189 |
+++ b/bin/ebuild-helpers/dosed |
190 |
@@ -1,7 +1,16 @@ |
191 |
#!/bin/bash |
192 |
-# Copyright 1999-2011 Gentoo Foundation |
193 |
+# Copyright 1999-2012 Gentoo Foundation |
194 |
# Distributed under the terms of the GNU General Public License v2 |
195 |
|
196 |
+case "${EAPI}" in |
197 |
+ 0|1|2|3) |
198 |
+ ;; |
199 |
+ *) |
200 |
+ die "'${0##*/}' has been banned for EAPI '$EAPI'" |
201 |
+ exit 1 |
202 |
+ ;; |
203 |
+esac |
204 |
+ |
205 |
if [[ $# -lt 1 ]] ; then |
206 |
echo "!!! ${0##*/}: at least one argument needed" >&2 |
207 |
exit 1 |
208 |
|
209 |
diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs |
210 |
index 560a02b..c9226d6 100755 |
211 |
--- a/bin/ebuild-helpers/prepalldocs |
212 |
+++ b/bin/ebuild-helpers/prepalldocs |
213 |
@@ -1,9 +1,18 @@ |
214 |
#!/bin/bash |
215 |
-# Copyright 1999-2011 Gentoo Foundation |
216 |
+# Copyright 1999-2012 Gentoo Foundation |
217 |
# Distributed under the terms of the GNU General Public License v2 |
218 |
|
219 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
220 |
|
221 |
+case "${EAPI}" in |
222 |
+ 0|1|2|3) |
223 |
+ ;; |
224 |
+ *) |
225 |
+ die "'${0##*/}' has been banned for EAPI '$EAPI'" |
226 |
+ exit 1 |
227 |
+ ;; |
228 |
+esac |
229 |
+ |
230 |
if [[ -n $1 ]] ; then |
231 |
vecho "${0##*/}: invalid usage; takes no arguments" 1>&2 |
232 |
fi |
233 |
|
234 |
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
235 |
index 85d44a1..fd7fb25 100644 |
236 |
--- a/bin/phase-functions.sh |
237 |
+++ b/bin/phase-functions.sh |
238 |
@@ -29,7 +29,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \ |
239 |
PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \ |
240 |
PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTDIR PORTDIR_OVERLAY \ |
241 |
PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \ |
242 |
- __PORTAGE_TEST_HARDLINK_LOCKS" |
243 |
+ __PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS" |
244 |
|
245 |
PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR" |
246 |
|
247 |
|
248 |
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py |
249 |
index 4d42537..1bcbbf7 100644 |
250 |
--- a/pym/portage/package/ebuild/_config/special_env_vars.py |
251 |
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py |
252 |
@@ -170,6 +170,7 @@ environ_filter += [ |
253 |
"RESUMECOMMAND_HTTP", "RESUMECOMMAND_HTTPS", |
254 |
"RESUMECOMMAND_RSYNC", "RESUMECOMMAND_SFTP", |
255 |
"SYNC", "UNINSTALL_IGNORE", "USE_EXPAND_HIDDEN", "USE_ORDER", |
256 |
+ "__PORTAGE_HELPER" |
257 |
] |
258 |
|
259 |
environ_filter = frozenset(environ_filter) |
260 |
|
261 |
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py |
262 |
index 9b678f7..9ca684e 100644 |
263 |
--- a/pym/portage/package/ebuild/doebuild.py |
264 |
+++ b/pym/portage/package/ebuild/doebuild.py |
265 |
@@ -155,9 +155,6 @@ def _doebuild_path(settings, eapi=None): |
266 |
|
267 |
path = [] |
268 |
|
269 |
- if eapi not in (None, "0", "1", "2", "3"): |
270 |
- path.append(os.path.join(portage_bin_path, "ebuild-helpers", "4")) |
271 |
- |
272 |
path.append(os.path.join(portage_bin_path, "ebuild-helpers")) |
273 |
path.extend(prerootpath) |