Gentoo Archives: gentoo-portage-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH] require PORTAGE_{BIN,PYM}_PATH not be cleared
Date: Wed, 10 Jun 2015 15:45:18
Message-Id: 1433951109-18393-1-git-send-email-vapier@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] make PORTAGE_BIN_PATH settings relocatable by Mike Frysinger
1 Rather than hardcode a full path everywhere as a fallback, assume the
2 value is always set to the right location. The current path isn't the
3 right place anymore already.
4
5 If it turns out we want to support this scenario, we can do it via a
6 bunch of bootstrapping (and symlinked) files.
7 ---
8 bin/ebuild-helpers/die | 2 +-
9 bin/ebuild-helpers/dobin | 2 +-
10 bin/ebuild-helpers/doconfd | 2 +-
11 bin/ebuild-helpers/dodir | 2 +-
12 bin/ebuild-helpers/dodoc | 2 +-
13 bin/ebuild-helpers/doenvd | 2 +-
14 bin/ebuild-helpers/doexe | 2 +-
15 bin/ebuild-helpers/dohard | 2 +-
16 bin/ebuild-helpers/doheader | 2 +-
17 bin/ebuild-helpers/dohtml | 6 ++----
18 bin/ebuild-helpers/doinfo | 2 +-
19 bin/ebuild-helpers/doinitd | 2 +-
20 bin/ebuild-helpers/doins | 2 +-
21 bin/ebuild-helpers/dolib | 2 +-
22 bin/ebuild-helpers/doman | 2 +-
23 bin/ebuild-helpers/domo | 2 +-
24 bin/ebuild-helpers/dosbin | 2 +-
25 bin/ebuild-helpers/dosed | 2 +-
26 bin/ebuild-helpers/dosym | 2 +-
27 bin/ebuild-helpers/ecompress | 2 +-
28 bin/ebuild-helpers/ecompressdir | 2 +-
29 bin/ebuild-helpers/elog | 2 +-
30 bin/ebuild-helpers/emake | 2 +-
31 bin/ebuild-helpers/fowners | 2 +-
32 bin/ebuild-helpers/fperms | 2 +-
33 bin/ebuild-helpers/keepdir | 2 +-
34 bin/ebuild-helpers/newins | 2 +-
35 bin/ebuild-helpers/portageq | 4 +---
36 bin/ebuild-helpers/prepall | 2 +-
37 bin/ebuild-helpers/prepalldocs | 2 +-
38 bin/ebuild-helpers/prepallinfo | 2 +-
39 bin/ebuild-helpers/prepallman | 2 +-
40 bin/ebuild-helpers/prepallstrip | 2 +-
41 bin/ebuild-helpers/prepinfo | 2 +-
42 bin/ebuild-helpers/prepman | 2 +-
43 bin/ebuild-helpers/prepstrip | 3 +--
44 bin/ebuild-helpers/unprivileged/chown | 4 ++--
45 bin/ebuild-helpers/xattr/install | 2 --
46 bin/ebuild-ipc | 4 +---
47 bin/ebuild.sh | 3 ---
48 bin/helper-functions.sh | 2 +-
49 bin/isolated-functions.sh | 2 +-
50 bin/misc-functions.sh | 2 +-
51 43 files changed, 43 insertions(+), 55 deletions(-)
52
53 diff --git a/bin/ebuild-helpers/die b/bin/ebuild-helpers/die
54 index 9869141..5c6b1d2 100755
55 --- a/bin/ebuild-helpers/die
56 +++ b/bin/ebuild-helpers/die
57 @@ -2,6 +2,6 @@
58 # Copyright 2010 Gentoo Foundation
59 # Distributed under the terms of the GNU General Public License v2
60
61 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
62 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
63 die "$@"
64 exit 1
65 diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
66 index 0ba1eb0..9f4d73d 100755
67 --- a/bin/ebuild-helpers/dobin
68 +++ b/bin/ebuild-helpers/dobin
69 @@ -2,7 +2,7 @@
70 # Copyright 1999-2012 Gentoo Foundation
71 # Distributed under the terms of the GNU General Public License v2
72
73 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
74 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
75
76 if [[ $# -lt 1 ]] ; then
77 __helpers_die "${0##*/}: at least one argument needed"
78 diff --git a/bin/ebuild-helpers/doconfd b/bin/ebuild-helpers/doconfd
79 index 1baa3ed..926c318 100755
80 --- a/bin/ebuild-helpers/doconfd
81 +++ b/bin/ebuild-helpers/doconfd
82 @@ -3,7 +3,7 @@
83 # Distributed under the terms of the GNU General Public License v2
84
85 if [[ $# -lt 1 ]] ; then
86 - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
87 + source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
88 __helpers_die "${0##*/}: at least one argument needed"
89 exit 1
90 fi
91 diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir
92 index e03ba9a..eed2c8b 100755
93 --- a/bin/ebuild-helpers/dodir
94 +++ b/bin/ebuild-helpers/dodir
95 @@ -2,7 +2,7 @@
96 # Copyright 1999-2012 Gentoo Foundation
97 # Distributed under the terms of the GNU General Public License v2
98
99 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
100 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
101
102 if ! ___eapi_has_prefix_variables; then
103 ED=${D}
104 diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc
105 index 6ccf0a4..75029eb 100755
106 --- a/bin/ebuild-helpers/dodoc
107 +++ b/bin/ebuild-helpers/dodoc
108 @@ -2,7 +2,7 @@
109 # Copyright 1999-2012 Gentoo Foundation
110 # Distributed under the terms of the GNU General Public License v2
111
112 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
113 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
114
115 if ___eapi_dodoc_supports_-r; then
116 __PORTAGE_HELPER='dodoc' exec doins "$@"
117 diff --git a/bin/ebuild-helpers/doenvd b/bin/ebuild-helpers/doenvd
118 index 67bb934..eb31f37 100755
119 --- a/bin/ebuild-helpers/doenvd
120 +++ b/bin/ebuild-helpers/doenvd
121 @@ -3,7 +3,7 @@
122 # Distributed under the terms of the GNU General Public License v2
123
124 if [[ $# -lt 1 ]] ; then
125 - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
126 + source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
127 __helpers_die "${0##*/}: at least one argument needed"
128 exit 1
129 fi
130 diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe
131 index c34fcae..8c4b9e9 100755
132 --- a/bin/ebuild-helpers/doexe
133 +++ b/bin/ebuild-helpers/doexe
134 @@ -2,7 +2,7 @@
135 # Copyright 1999-2012 Gentoo Foundation
136 # Distributed under the terms of the GNU General Public License v2
137
138 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
139 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
140
141 if [[ $# -lt 1 ]] ; then
142 __helpers_die "${0##*/}: at least one argument needed"
143 diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard
144 index e0a44fa..8a93fad 100755
145 --- a/bin/ebuild-helpers/dohard
146 +++ b/bin/ebuild-helpers/dohard
147 @@ -2,7 +2,7 @@
148 # Copyright 1999-2012 Gentoo Foundation
149 # Distributed under the terms of the GNU General Public License v2
150
151 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
152 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
153
154 if ! ___eapi_has_dohard; then
155 die "'${0##*/}' has been banned for EAPI '$EAPI'"
156 diff --git a/bin/ebuild-helpers/doheader b/bin/ebuild-helpers/doheader
157 index e4cae6a..b827086 100755
158 --- a/bin/ebuild-helpers/doheader
159 +++ b/bin/ebuild-helpers/doheader
160 @@ -2,7 +2,7 @@
161 # Copyright 1999-2012 Gentoo Foundation
162 # Distributed under the terms of the GNU General Public License v2
163
164 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
165 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
166
167 if ! ___eapi_has_doheader; then
168 die "${0##*/} is not supported in EAPI ${EAPI}"
169 diff --git a/bin/ebuild-helpers/dohtml b/bin/ebuild-helpers/dohtml
170 index 0478e49..860d4ab 100755
171 --- a/bin/ebuild-helpers/dohtml
172 +++ b/bin/ebuild-helpers/dohtml
173 @@ -2,17 +2,15 @@
174 # Copyright 2009-2013 Gentoo Foundation
175 # Distributed under the terms of the GNU General Public License v2
176
177 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
178 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
179
180 if ___eapi_has_dohtml_deprecated; then
181 eqawarn "'${0##*/}' is deprecated in EAPI '$EAPI'"
182 fi
183
184 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
185 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
186 # Use safe cwd, avoiding unsafe import for bug #469338.
187 export __PORTAGE_HELPER_CWD=${PWD}
188 -cd "${PORTAGE_PYM_PATH}"
189 +cd "${PORTAGE_PYM_PATH}" || die
190 PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
191 "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/dohtml.py" "$@"
192
193 diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo
194 index 2edbdc5..24b5ddd 100755
195 --- a/bin/ebuild-helpers/doinfo
196 +++ b/bin/ebuild-helpers/doinfo
197 @@ -2,7 +2,7 @@
198 # Copyright 1999-2012 Gentoo Foundation
199 # Distributed under the terms of the GNU General Public License v2
200
201 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
202 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
203
204 if [[ -z $1 ]] ; then
205 __helpers_die "${0##*/}: at least one argument needed"
206 diff --git a/bin/ebuild-helpers/doinitd b/bin/ebuild-helpers/doinitd
207 index aa7b66c..a216d98 100755
208 --- a/bin/ebuild-helpers/doinitd
209 +++ b/bin/ebuild-helpers/doinitd
210 @@ -3,7 +3,7 @@
211 # Distributed under the terms of the GNU General Public License v2
212
213 if [[ $# -lt 1 ]] ; then
214 - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
215 + source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
216 __helpers_die "${0##*/}: at least one argument needed"
217 exit 1
218 fi
219 diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
220 index c60e057..93052c2 100755
221 --- a/bin/ebuild-helpers/doins
222 +++ b/bin/ebuild-helpers/doins
223 @@ -2,7 +2,7 @@
224 # Copyright 1999-2012 Gentoo Foundation
225 # Distributed under the terms of the GNU General Public License v2
226
227 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
228 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
229
230 helper=${__PORTAGE_HELPER:-${0##*/}}
231
232 diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
233 index fd92d7f..a11bad4 100755
234 --- a/bin/ebuild-helpers/dolib
235 +++ b/bin/ebuild-helpers/dolib
236 @@ -2,7 +2,7 @@
237 # Copyright 1999-2012 Gentoo Foundation
238 # Distributed under the terms of the GNU General Public License v2
239
240 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
241 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
242
243 if ! ___eapi_has_prefix_variables; then
244 ED=${D}
245 diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman
246 index d680859..da66ac3 100755
247 --- a/bin/ebuild-helpers/doman
248 +++ b/bin/ebuild-helpers/doman
249 @@ -2,7 +2,7 @@
250 # Copyright 1999-2012 Gentoo Foundation
251 # Distributed under the terms of the GNU General Public License v2
252
253 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
254 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
255
256 if [[ $# -lt 1 ]] ; then
257 __helpers_die "${0##*/}: at least one argument needed"
258 diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo
259 index 9a8dda3..9742173 100755
260 --- a/bin/ebuild-helpers/domo
261 +++ b/bin/ebuild-helpers/domo
262 @@ -2,7 +2,7 @@
263 # Copyright 1999-2012 Gentoo Foundation
264 # Distributed under the terms of the GNU General Public License v2
265
266 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
267 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
268
269 mynum=${#}
270 if [ ${mynum} -lt 1 ] ; then
271 diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin
272 index 361ca83..2fee9d4 100755
273 --- a/bin/ebuild-helpers/dosbin
274 +++ b/bin/ebuild-helpers/dosbin
275 @@ -2,7 +2,7 @@
276 # Copyright 1999-2012 Gentoo Foundation
277 # Distributed under the terms of the GNU General Public License v2
278
279 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
280 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
281
282 if [[ $# -lt 1 ]] ; then
283 __helpers_die "${0##*/}: at least one argument needed"
284 diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed
285 index 7db0629..1e10d12 100755
286 --- a/bin/ebuild-helpers/dosed
287 +++ b/bin/ebuild-helpers/dosed
288 @@ -2,7 +2,7 @@
289 # Copyright 1999-2012 Gentoo Foundation
290 # Distributed under the terms of the GNU General Public License v2
291
292 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
293 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
294
295 if ! ___eapi_has_dosed; then
296 die "'${0##*/}' has been banned for EAPI '$EAPI'"
297 diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
298 index 649b100..0bc8cc7 100755
299 --- a/bin/ebuild-helpers/dosym
300 +++ b/bin/ebuild-helpers/dosym
301 @@ -2,7 +2,7 @@
302 # Copyright 1999-2012 Gentoo Foundation
303 # Distributed under the terms of the GNU General Public License v2
304
305 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
306 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
307
308 if [[ $# -ne 2 ]] ; then
309 __helpers_die "${0##*/}: two arguments needed"
310 diff --git a/bin/ebuild-helpers/ecompress b/bin/ebuild-helpers/ecompress
311 index 71287b4..50ee811 100755
312 --- a/bin/ebuild-helpers/ecompress
313 +++ b/bin/ebuild-helpers/ecompress
314 @@ -2,7 +2,7 @@
315 # Copyright 1999-2010 Gentoo Foundation
316 # Distributed under the terms of the GNU General Public License v2
317
318 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
319 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
320
321 if [[ -z $1 ]] ; then
322 __helpers_die "${0##*/}: at least one argument needed"
323 diff --git a/bin/ebuild-helpers/ecompressdir b/bin/ebuild-helpers/ecompressdir
324 index eca5888..4f57262 100755
325 --- a/bin/ebuild-helpers/ecompressdir
326 +++ b/bin/ebuild-helpers/ecompressdir
327 @@ -2,7 +2,7 @@
328 # Copyright 1999-2013 Gentoo Foundation
329 # Distributed under the terms of the GNU General Public License v2
330
331 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
332 +source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
333
334 if [[ -z $1 ]] ; then
335 __helpers_die "${0##*/}: at least one argument needed"
336 diff --git a/bin/ebuild-helpers/elog b/bin/ebuild-helpers/elog
337 index a2303af..911f8d5 100755
338 --- a/bin/ebuild-helpers/elog
339 +++ b/bin/ebuild-helpers/elog
340 @@ -2,6 +2,6 @@
341 # Copyright 1999-2009 Gentoo Foundation
342 # Distributed under the terms of the GNU General Public License v2
343
344 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
345 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
346
347 ${0##*/} "$@"
348 diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake
349 index 2a3c2f0..60718a2 100755
350 --- a/bin/ebuild-helpers/emake
351 +++ b/bin/ebuild-helpers/emake
352 @@ -9,7 +9,7 @@
353 #
354 # With newer EAPIs, we also automatically fail the build if make itself fails.
355
356 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
357 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
358
359 cmd=(
360 ${MAKE:-make} ${MAKEOPTS} "$@" ${EXTRA_EMAKE}
361 diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
362 index cee4108..85f7fd6 100755
363 --- a/bin/ebuild-helpers/fowners
364 +++ b/bin/ebuild-helpers/fowners
365 @@ -2,7 +2,7 @@
366 # Copyright 1999-2012 Gentoo Foundation
367 # Distributed under the terms of the GNU General Public License v2
368
369 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
370 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
371
372 if ! ___eapi_has_prefix_variables; then
373 EPREFIX= ED=${D}
374 diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
375 index d854ebb..297679c 100755
376 --- a/bin/ebuild-helpers/fperms
377 +++ b/bin/ebuild-helpers/fperms
378 @@ -2,7 +2,7 @@
379 # Copyright 1999-2012 Gentoo Foundation
380 # Distributed under the terms of the GNU General Public License v2
381
382 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
383 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
384
385 if ! ___eapi_has_prefix_variables; then
386 ED=${D}
387 diff --git a/bin/ebuild-helpers/keepdir b/bin/ebuild-helpers/keepdir
388 index bec2feb..e0c852d 100755
389 --- a/bin/ebuild-helpers/keepdir
390 +++ b/bin/ebuild-helpers/keepdir
391 @@ -2,7 +2,7 @@
392 # Copyright 1999-2013 Gentoo Foundation
393 # Distributed under the terms of the GNU General Public License v2
394
395 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
396 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
397
398 if ! ___eapi_has_prefix_variables; then
399 ED=${D}
400 diff --git a/bin/ebuild-helpers/newins b/bin/ebuild-helpers/newins
401 index 0335985..8032a8f 100755
402 --- a/bin/ebuild-helpers/newins
403 +++ b/bin/ebuild-helpers/newins
404 @@ -2,7 +2,7 @@
405 # Copyright 1999-2012 Gentoo Foundation
406 # Distributed under the terms of the GNU General Public License v2
407
408 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
409 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
410
411 helper=${0##*/}
412
413 diff --git a/bin/ebuild-helpers/portageq b/bin/ebuild-helpers/portageq
414 index ba889eb..b314bce 100755
415 --- a/bin/ebuild-helpers/portageq
416 +++ b/bin/ebuild-helpers/portageq
417 @@ -5,10 +5,8 @@
418 scriptpath=${BASH_SOURCE[0]}
419 scriptname=${scriptpath##*/}
420
421 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
422 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
423 # Use safe cwd, avoiding unsafe import for bug #469338.
424 -cd "${PORTAGE_PYM_PATH}"
425 +cd "${PORTAGE_PYM_PATH}" || exit 1
426
427 IFS=':'
428 set -f # in case ${PATH} contains any shell glob characters
429 diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
430 index fb5c2db..44643bb 100755
431 --- a/bin/ebuild-helpers/prepall
432 +++ b/bin/ebuild-helpers/prepall
433 @@ -2,7 +2,7 @@
434 # Copyright 1999-2012 Gentoo Foundation
435 # Distributed under the terms of the GNU General Public License v2
436
437 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
438 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
439
440 if ! ___eapi_has_prefix_variables; then
441 ED=${D}
442 diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
443 index 3094661..cf63c64 100755
444 --- a/bin/ebuild-helpers/prepalldocs
445 +++ b/bin/ebuild-helpers/prepalldocs
446 @@ -2,7 +2,7 @@
447 # Copyright 1999-2012 Gentoo Foundation
448 # Distributed under the terms of the GNU General Public License v2
449
450 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
451 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
452
453 if ___eapi_has_docompress; then
454 die "'${0##*/}' has been banned for EAPI '$EAPI'"
455 diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo
456 index 1a20275..cdf149e 100755
457 --- a/bin/ebuild-helpers/prepallinfo
458 +++ b/bin/ebuild-helpers/prepallinfo
459 @@ -2,7 +2,7 @@
460 # Copyright 1999-2012 Gentoo Foundation
461 # Distributed under the terms of the GNU General Public License v2
462
463 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
464 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
465
466 if ! ___eapi_has_prefix_variables; then
467 ED=${D}
468 diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman
469 index 5331eaf..03b10a8 100755
470 --- a/bin/ebuild-helpers/prepallman
471 +++ b/bin/ebuild-helpers/prepallman
472 @@ -2,7 +2,7 @@
473 # Copyright 1999-2012 Gentoo Foundation
474 # Distributed under the terms of the GNU General Public License v2
475
476 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
477 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
478
479 # replaced by controllable compression in EAPI 4
480 ___eapi_has_docompress && exit 0
481 diff --git a/bin/ebuild-helpers/prepallstrip b/bin/ebuild-helpers/prepallstrip
482 index 1aa6686..59fa7cc 100755
483 --- a/bin/ebuild-helpers/prepallstrip
484 +++ b/bin/ebuild-helpers/prepallstrip
485 @@ -2,7 +2,7 @@
486 # Copyright 1999-2012 Gentoo Foundation
487 # Distributed under the terms of the GNU General Public License v2
488
489 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
490 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
491
492 if ! ___eapi_has_prefix_variables; then
493 ED=${D}
494 diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo
495 index 5afc18a..a64d144 100755
496 --- a/bin/ebuild-helpers/prepinfo
497 +++ b/bin/ebuild-helpers/prepinfo
498 @@ -2,7 +2,7 @@
499 # Copyright 1999-2012 Gentoo Foundation
500 # Distributed under the terms of the GNU General Public License v2
501
502 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
503 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
504
505 if ! ___eapi_has_prefix_variables; then
506 ED=${D}
507 diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
508 index fb5dcb4..e64acc0 100755
509 --- a/bin/ebuild-helpers/prepman
510 +++ b/bin/ebuild-helpers/prepman
511 @@ -5,7 +5,7 @@
512 # Do not compress man pages which are smaller than this (in bytes). #169260
513 SIZE_LIMIT='128'
514
515 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
516 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
517
518 if ! ___eapi_has_prefix_variables; then
519 ED=${D}
520 diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
521 index 2ef8a1a..43caa29 100755
522 --- a/bin/ebuild-helpers/prepstrip
523 +++ b/bin/ebuild-helpers/prepstrip
524 @@ -2,8 +2,7 @@
525 # Copyright 1999-2014 Gentoo Foundation
526 # Distributed under the terms of the GNU General Public License v2
527
528 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
529 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
530 +source "${PORTAGE_BIN_PATH}"/helper-functions.sh || exit 1
531
532 # avoid multiple calls to `has`. this creates things like:
533 # FEATURES_foo=false
534 diff --git a/bin/ebuild-helpers/unprivileged/chown b/bin/ebuild-helpers/unprivileged/chown
535 index 2f1f161..b57dc8a 100755
536 --- a/bin/ebuild-helpers/unprivileged/chown
537 +++ b/bin/ebuild-helpers/unprivileged/chown
538 @@ -2,6 +2,8 @@
539 # Copyright 2012-2015 Gentoo Foundation
540 # Distributed under the terms of the GNU General Public License v2
541
542 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
543 +
544 scriptpath=${BASH_SOURCE[0]}
545 scriptname=${scriptpath##*/}
546
547 @@ -23,8 +25,6 @@ for path in ${PATH}; do
548 output="${output}\n ... (further messages truncated)"
549 fi
550
551 - source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
552 -
553 if ! ___eapi_has_prefix_variables; then
554 EPREFIX=
555 fi
556 diff --git a/bin/ebuild-helpers/xattr/install b/bin/ebuild-helpers/xattr/install
557 index 2d2a693..4d596e1 100755
558 --- a/bin/ebuild-helpers/xattr/install
559 +++ b/bin/ebuild-helpers/xattr/install
560 @@ -2,8 +2,6 @@
561 # Copyright 2013-2015 Gentoo Foundation
562 # Distributed under the terms of the GNU General Public License v2
563
564 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
565 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
566 INSTALL_XATTR=${EPREFIX}/usr/bin/install-xattr
567 # Use safe cwd, avoiding unsafe import for bug #469338.
568 export __PORTAGE_HELPER_CWD=${PWD}
569 diff --git a/bin/ebuild-ipc b/bin/ebuild-ipc
570 index 820005f..e77b94b 100755
571 --- a/bin/ebuild-ipc
572 +++ b/bin/ebuild-ipc
573 @@ -2,9 +2,7 @@
574 # Copyright 2010-2013 Gentoo Foundation
575 # Distributed under the terms of the GNU General Public License v2
576
577 -PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
578 -PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
579 # Use safe cwd, avoiding unsafe import for bug #469338.
580 -cd "${PORTAGE_PYM_PATH}"
581 +cd "${PORTAGE_PYM_PATH}" || exit 1
582 PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
583 exec "${PORTAGE_PYTHON:-/usr/bin/python}" "$PORTAGE_BIN_PATH/ebuild-ipc.py" "$@"
584 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
585 index 4e26f87..75a9d24 100755
586 --- a/bin/ebuild.sh
587 +++ b/bin/ebuild.sh
588 @@ -2,9 +2,6 @@
589 # Copyright 1999-2015 Gentoo Foundation
590 # Distributed under the terms of the GNU General Public License v2
591
592 -PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"
593 -PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}"
594 -
595 # Prevent aliases from causing portage to act inappropriately.
596 # Make sure it's before everything so we don't mess aliases that follow.
597 unalias -a
598 diff --git a/bin/helper-functions.sh b/bin/helper-functions.sh
599 index b9bc74a..c096aed 100644
600 --- a/bin/helper-functions.sh
601 +++ b/bin/helper-functions.sh
602 @@ -5,7 +5,7 @@
603 # For routines we want to use in ebuild-helpers/ but don't want to
604 # expose to the general ebuild environment.
605
606 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
607 +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
608
609 #
610 # API functions for doing parallel processing
611 diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
612 index 8e789ec..003c01d 100644
613 --- a/bin/isolated-functions.sh
614 +++ b/bin/isolated-functions.sh
615 @@ -2,7 +2,7 @@
616 # Copyright 1999-2014 Gentoo Foundation
617 # Distributed under the terms of the GNU General Public License v2
618
619 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/eapi.sh"
620 +source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
621
622 # We need this next line for "die" and "assert". It expands
623 # It _must_ preceed all the calls to die and assert.
624 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
625 index 24941af..9b79351 100755
626 --- a/bin/misc-functions.sh
627 +++ b/bin/misc-functions.sh
628 @@ -14,7 +14,7 @@
629 MISC_FUNCTIONS_ARGS="$@"
630 shift $#
631
632 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh"
633 +source "${PORTAGE_BIN_PATH}/ebuild.sh" || exit 1
634
635 install_symlink_html_docs() {
636 if ! ___eapi_has_prefix_variables; then
637 --
638 2.4.1

Replies