1 |
commit: 8546a58d3ce8359538c6847d3b7330322fb2c133 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 2 19:14:03 2011 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 2 19:14:03 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8546a58d |
7 |
|
8 |
Merge commit 'v2.2.0_alpha74' into prefix |
9 |
|
10 |
Most important, fix the _doebuild_path function for Prefix |
11 |
|
12 |
Conflicts: |
13 |
bin/dohtml.py |
14 |
bin/ebuild-helpers/dobin |
15 |
bin/ebuild-helpers/dodir |
16 |
bin/ebuild-helpers/dodoc |
17 |
bin/ebuild-helpers/doexe |
18 |
bin/ebuild-helpers/dohard |
19 |
bin/ebuild-helpers/doinfo |
20 |
bin/ebuild-helpers/doins |
21 |
bin/ebuild-helpers/dolib |
22 |
bin/ebuild-helpers/domo |
23 |
bin/ebuild-helpers/dosbin |
24 |
bin/ebuild-helpers/dosed |
25 |
bin/ebuild-helpers/dosym |
26 |
bin/ebuild-helpers/ecompressdir |
27 |
bin/ebuild-helpers/fowners |
28 |
bin/ebuild-helpers/fperms |
29 |
bin/ebuild-helpers/prepalldocs |
30 |
bin/ebuild-helpers/prepallinfo |
31 |
bin/ebuild-helpers/prepallman |
32 |
bin/ebuild-helpers/prepallstrip |
33 |
bin/ebuild-helpers/prepinfo |
34 |
bin/ebuild-helpers/preplib |
35 |
bin/ebuild-helpers/prepstrip |
36 |
bin/ebuild.sh |
37 |
bin/misc-functions.sh |
38 |
bin/phase-helpers.sh |
39 |
pym/portage/dbapi/bintree.py |
40 |
|
41 |
|
42 |
RELEASE-NOTES | 5 + |
43 |
bin/dohtml.py | 13 ++- |
44 |
bin/ebuild-helpers/dobin | 4 + |
45 |
bin/ebuild-helpers/dodir | 6 +- |
46 |
bin/ebuild-helpers/dodoc | 7 +- |
47 |
bin/ebuild-helpers/doexe | 6 +- |
48 |
bin/ebuild-helpers/dohard | 6 +- |
49 |
bin/ebuild-helpers/doinfo | 6 +- |
50 |
bin/ebuild-helpers/doins | 10 +- |
51 |
bin/ebuild-helpers/dolib | 6 +- |
52 |
bin/ebuild-helpers/doman | 2 + |
53 |
bin/ebuild-helpers/domo | 7 +- |
54 |
bin/ebuild-helpers/dosbin | 6 +- |
55 |
bin/ebuild-helpers/dosed | 6 +- |
56 |
bin/ebuild-helpers/dosym | 10 ++- |
57 |
bin/ebuild-helpers/ecompressdir | 19 +++-- |
58 |
bin/ebuild-helpers/fowners | 6 +- |
59 |
bin/ebuild-helpers/fperms | 5 +- |
60 |
bin/ebuild-helpers/prepall | 2 + |
61 |
bin/ebuild-helpers/prepalldocs | 9 +- |
62 |
bin/ebuild-helpers/prepallinfo | 10 ++- |
63 |
bin/ebuild-helpers/prepallman | 6 + |
64 |
bin/ebuild-helpers/prepallstrip | 6 +- |
65 |
bin/ebuild-helpers/prepinfo | 10 ++- |
66 |
bin/ebuild-helpers/preplib | 6 +- |
67 |
bin/ebuild-helpers/prepman | 2 + |
68 |
bin/ebuild-helpers/prepstrip | 20 +++- |
69 |
bin/ebuild.sh | 56 ++--------- |
70 |
bin/isolated-functions.sh | 27 +++--- |
71 |
bin/misc-functions.sh | 103 +++++++++++++------- |
72 |
bin/phase-functions.sh | 13 ++- |
73 |
bin/phase-helpers.sh | 66 +++++++++++-- |
74 |
bin/save-ebuild-env.sh | 11 ++- |
75 |
man/emerge.1 | 11 ++- |
76 |
pym/_emerge/actions.py | 2 +- |
77 |
pym/_emerge/depgraph.py | 15 ++-- |
78 |
pym/_emerge/main.py | 46 ++++++---- |
79 |
pym/_emerge/resolver/circular_dependency.py | 5 +- |
80 |
pym/_emerge/resolver/output_helpers.py | 49 ++++++---- |
81 |
pym/_emerge/resolver/slot_collision.py | 2 +- |
82 |
pym/portage/dbapi/bintree.py | 5 +- |
83 |
pym/portage/dbapi/vartree.py | 2 +- |
84 |
.../package/ebuild/_config/special_env_vars.py | 3 +- |
85 |
pym/portage/package/ebuild/doebuild.py | 79 +++++++++++++-- |
86 |
pym/portage/tests/bin/setup_env.py | 1 + |
87 |
pym/portage/tests/emerge/test_simple.py | 39 ++++++-- |
88 |
pym/portage/tests/resolver/test_multislot.py | 4 +- |
89 |
runtests.sh | 2 +- |
90 |
48 files changed, 508 insertions(+), 234 deletions(-) |
91 |
|
92 |
diff --cc bin/dohtml.py |
93 |
index bf9bcc8,122daf3..546e698 |
94 |
--- a/bin/dohtml.py |
95 |
+++ b/bin/dohtml.py |
96 |
@@@ -91,8 -91,10 +91,13 @@@ class OptionsClass |
97 |
|
98 |
if "PF" in os.environ: |
99 |
self.PF = os.environ["PF"] |
100 |
- if os.environ.has_key("ED"): |
101 |
- self.ED = os.environ["ED"] |
102 |
- if os.environ.get("EAPI", "0") in ("0", "1", "2"): |
103 |
- self.ED = os.environ.get("D", "") |
104 |
- else: |
105 |
++ # PREFIX LOCAL: always retrieve ED |
106 |
++ #if os.environ.get("EAPI", "0") in ("0", "1", "2"): |
107 |
++ # self.ED = os.environ.get("D", "") |
108 |
++ #else: |
109 |
++ if True: |
110 |
+ self.ED = os.environ.get("ED", "") |
111 |
++ # END PREFIX LOCAL |
112 |
if "_E_DOCDESTTREE_" in os.environ: |
113 |
self.DOCDESTTREE = os.environ["_E_DOCDESTTREE_"] |
114 |
|
115 |
diff --cc bin/ebuild-helpers/dobin |
116 |
index e158a71,af3af0d..8adc65d |
117 |
--- a/bin/ebuild-helpers/dobin |
118 |
+++ b/bin/ebuild-helpers/dobin |
119 |
@@@ -9,6 -9,8 +9,10 @@@ if [[ $# -lt 1 ]] ; the |
120 |
exit 1 |
121 |
fi |
122 |
|
123 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
124 |
++# PREFIX LOCAL: always support ED |
125 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
126 |
++# END PREFIX LOCAL |
127 |
+ |
128 |
if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then |
129 |
install -d "${ED}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; } |
130 |
fi |
131 |
diff --cc bin/ebuild-helpers/dodir |
132 |
index 7da507a,7db7caf..06dd2fe |
133 |
--- a/bin/ebuild-helpers/dodir |
134 |
+++ b/bin/ebuild-helpers/dodir |
135 |
@@@ -1,9 -1,11 +1,13 @@@ |
136 |
-#!/bin/bash |
137 |
+#!@PORTAGE_BASH@ |
138 |
- # Copyright 1999-2010 Gentoo Foundation |
139 |
+ # Copyright 1999-2011 Gentoo Foundation |
140 |
# Distributed under the terms of the GNU General Public License v2 |
141 |
|
142 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
143 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
144 |
|
145 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
146 |
++# PREFIX LOCAL: always support ED |
147 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
148 |
++# END PREFIX LOCAL |
149 |
+ |
150 |
install -d ${DIROPTIONS} "${@/#/${ED}/}" |
151 |
ret=$? |
152 |
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed" |
153 |
diff --cc bin/ebuild-helpers/dodoc |
154 |
index 41fc8f5,37bbc79..d1bcb4f |
155 |
--- a/bin/ebuild-helpers/dodoc |
156 |
+++ b/bin/ebuild-helpers/dodoc |
157 |
@@@ -1,5 -1,4 +1,4 @@@ |
158 |
-#!/bin/bash |
159 |
+#!@PORTAGE_BASH@ |
160 |
- #!/bin/bash |
161 |
# Copyright 1999-2011 Gentoo Foundation |
162 |
# Distributed under the terms of the GNU General Public License v2 |
163 |
|
164 |
@@@ -10,7 -9,9 +9,11 @@@ if [ $# -lt 1 ] ; the |
165 |
exit 1 |
166 |
fi |
167 |
|
168 |
- dir="${ED}/usr/share/doc/${PF}/${_E_DOCDESTTREE_}" |
169 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
170 |
++# PREFIX LOCAL: always support ED |
171 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
172 |
++# END PREFIX LOCAL |
173 |
+ |
174 |
+ dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" |
175 |
if [ ! -d "${dir}" ] ; then |
176 |
install -d "${dir}" |
177 |
fi |
178 |
diff --cc bin/ebuild-helpers/doexe |
179 |
index 4f40402,a5b9af0..ecf0b9a |
180 |
--- a/bin/ebuild-helpers/doexe |
181 |
+++ b/bin/ebuild-helpers/doexe |
182 |
@@@ -1,14 -1,16 +1,18 @@@ |
183 |
-#!/bin/bash |
184 |
+#!@PORTAGE_BASH@ |
185 |
- # Copyright 1999-2010 Gentoo Foundation |
186 |
+ # Copyright 1999-2011 Gentoo Foundation |
187 |
# Distributed under the terms of the GNU General Public License v2 |
188 |
|
189 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
190 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
191 |
|
192 |
if [[ $# -lt 1 ]] ; then |
193 |
helpers_die "${0##*/}: at least one argument needed" |
194 |
exit 1 |
195 |
fi |
196 |
|
197 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
198 |
++# PREFIX LOCAL: always support ED |
199 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
200 |
++# END PREFIX LOCAL |
201 |
+ |
202 |
if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then |
203 |
install -d "${ED}${_E_EXEDESTTREE_}" |
204 |
fi |
205 |
diff --cc bin/ebuild-helpers/dohard |
206 |
index c7c568c,cf6fb11..b5f8f70 |
207 |
--- a/bin/ebuild-helpers/dohard |
208 |
+++ b/bin/ebuild-helpers/dohard |
209 |
@@@ -1,5 -1,5 +1,5 @@@ |
210 |
-#!/bin/bash |
211 |
+#!@PORTAGE_BASH@ |
212 |
- # Copyright 1999-2007 Gentoo Foundation |
213 |
+ # Copyright 1999-2011 Gentoo Foundation |
214 |
# Distributed under the terms of the GNU General Public License v2 |
215 |
|
216 |
if [[ $# -ne 2 ]] ; then |
217 |
@@@ -7,6 -7,8 +7,10 @@@ |
218 |
exit 1 |
219 |
fi |
220 |
|
221 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
222 |
++# PREFIX LOCAL: always support ED |
223 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
224 |
++# END PREFIX LOCAL |
225 |
+ |
226 |
destdir=${2%/*} |
227 |
[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}" |
228 |
|
229 |
diff --cc bin/ebuild-helpers/doinfo |
230 |
index 3cfbe6f,a922ef1..56d9821 |
231 |
--- a/bin/ebuild-helpers/doinfo |
232 |
+++ b/bin/ebuild-helpers/doinfo |
233 |
@@@ -1,5 -1,5 +1,5 @@@ |
234 |
-#!/bin/bash |
235 |
+#!@PORTAGE_BASH@ |
236 |
- # Copyright 1999-2010 Gentoo Foundation |
237 |
+ # Copyright 1999-2011 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 |
@@@ -9,6 -9,8 +9,10 @@@ if [[ -z $1 ]] ; the |
242 |
exit 1 |
243 |
fi |
244 |
|
245 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
246 |
++# PREFIX LOCAL: always support ED |
247 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
248 |
++# END PREFIX LOCAL |
249 |
+ |
250 |
if [[ ! -d ${ED}usr/share/info ]] ; then |
251 |
install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; } |
252 |
fi |
253 |
diff --cc bin/ebuild-helpers/doins |
254 |
index c91883b,b9189d5..46796cb |
255 |
--- a/bin/ebuild-helpers/doins |
256 |
+++ b/bin/ebuild-helpers/doins |
257 |
@@@ -32,16 -34,9 +34,16 @@@ if [[ ${INSDESTTREE#${ED}} != "${INSDES |
258 |
vecho "You should not use \${D} or \${ED} with helpers." 1>&2 |
259 |
vecho " --> ${INSDESTTREE}" 1>&2 |
260 |
vecho "-------------------------------------------------------" 1>&2 |
261 |
- helpers_die "${0##*/} used with \${D}" |
262 |
+ helpers_die "${0##*/} used with \${D} or \${ED}" |
263 |
exit 1 |
264 |
fi |
265 |
+if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then |
266 |
+ vecho "-------------------------------------------------------" 1>&2 |
267 |
+ vecho "You should not use \${EPREFIX} with helpers." 1>&2 |
268 |
+ vecho " --> ${INSDESTTREE}" 1>&2 |
269 |
+ vecho "-------------------------------------------------------" 1>&2 |
270 |
+ exit 1 |
271 |
+fi |
272 |
|
273 |
case "$EAPI" in |
274 |
0|1|2|3|3_pre2) |
275 |
diff --cc bin/ebuild-helpers/dolib |
276 |
index 53805ea,9dd11d8..5b1b1be |
277 |
--- a/bin/ebuild-helpers/dolib |
278 |
+++ b/bin/ebuild-helpers/dolib |
279 |
@@@ -1,9 -1,11 +1,13 @@@ |
280 |
-#!/bin/bash |
281 |
+#!@PORTAGE_BASH@ |
282 |
- # Copyright 1999-2010 Gentoo Foundation |
283 |
+ # Copyright 1999-2011 Gentoo Foundation |
284 |
# Distributed under the terms of the GNU General Public License v2 |
285 |
|
286 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
287 |
|
288 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
289 |
++# PREFIX LOCAL: always support ED |
290 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
291 |
++# END PREFIX LOCAL |
292 |
+ |
293 |
# Setup ABI cruft |
294 |
LIBDIR_VAR="LIBDIR_${ABI}" |
295 |
if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then |
296 |
diff --cc bin/ebuild-helpers/domo |
297 |
index f8a7bb9,0e3656d..33af83e |
298 |
--- a/bin/ebuild-helpers/domo |
299 |
+++ b/bin/ebuild-helpers/domo |
300 |
@@@ -1,5 -1,5 +1,5 @@@ |
301 |
-#!/bin/bash |
302 |
+#!@PORTAGE_BASH@ |
303 |
- # Copyright 1999-2010 Gentoo Foundation |
304 |
+ # Copyright 1999-2011 Gentoo Foundation |
305 |
# Distributed under the terms of the GNU General Public License v2 |
306 |
|
307 |
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
308 |
@@@ -9,6 -9,9 +9,11 @@@ if [ ${mynum} -lt 1 ] ; the |
309 |
helpers_die "${0}: at least one argument needed" |
310 |
exit 1 |
311 |
fi |
312 |
+ |
313 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
314 |
++# PREFIX LOCAL: always support ED |
315 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
316 |
++# END PREFIX LOCAL |
317 |
+ |
318 |
if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then |
319 |
install -d "${ED}${DESTTREE}/share/locale/" |
320 |
fi |
321 |
diff --cc bin/ebuild-helpers/dosbin |
322 |
index d1400f4,d0783ed..e52df71 |
323 |
--- a/bin/ebuild-helpers/dosbin |
324 |
+++ b/bin/ebuild-helpers/dosbin |
325 |
@@@ -1,14 -1,16 +1,18 @@@ |
326 |
-#!/bin/bash |
327 |
+#!@PORTAGE_BASH@ |
328 |
- # Copyright 1999-2010 Gentoo Foundation |
329 |
+ # Copyright 1999-2011 Gentoo Foundation |
330 |
# Distributed under the terms of the GNU General Public License v2 |
331 |
|
332 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
333 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
334 |
|
335 |
if [[ $# -lt 1 ]] ; then |
336 |
helpers_die "${0##*/}: at least one argument needed" |
337 |
exit 1 |
338 |
fi |
339 |
|
340 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
341 |
++# PREFIX LOCAL: always support ED |
342 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
343 |
++# END PREFIX LOCAL |
344 |
+ |
345 |
if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then |
346 |
install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; } |
347 |
fi |
348 |
diff --cc bin/ebuild-helpers/dosed |
349 |
index 40cf39a,00cf5da..5e234b3 |
350 |
--- a/bin/ebuild-helpers/dosed |
351 |
+++ b/bin/ebuild-helpers/dosed |
352 |
@@@ -1,5 -1,5 +1,5 @@@ |
353 |
-#!/bin/bash |
354 |
+#!@PORTAGE_BASH@ |
355 |
- # Copyright 1999-2006 Gentoo Foundation |
356 |
+ # Copyright 1999-2011 Gentoo Foundation |
357 |
# Distributed under the terms of the GNU General Public License v2 |
358 |
|
359 |
if [[ $# -lt 1 ]] ; then |
360 |
@@@ -7,6 -7,8 +7,10 @@@ |
361 |
exit 1 |
362 |
fi |
363 |
|
364 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
365 |
++# PREFIX LOCAL: always support ED |
366 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
367 |
++# END PREFIX LOCAL |
368 |
+ |
369 |
ret=0 |
370 |
file_found=0 |
371 |
mysed="s:${ED}::g" |
372 |
diff --cc bin/ebuild-helpers/dosym |
373 |
index 16e0df0,8b7b304..e5da333 |
374 |
--- a/bin/ebuild-helpers/dosym |
375 |
+++ b/bin/ebuild-helpers/dosym |
376 |
@@@ -1,14 -1,16 +1,18 @@@ |
377 |
-#!/bin/bash |
378 |
+#!@PORTAGE_BASH@ |
379 |
- # Copyright 1999-2010 Gentoo Foundation |
380 |
+ # Copyright 1999-2011 Gentoo Foundation |
381 |
# Distributed under the terms of the GNU General Public License v2 |
382 |
|
383 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
384 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
385 |
|
386 |
if [[ $# -ne 2 ]] ; then |
387 |
helpers_die "${0##*/}: two arguments needed" |
388 |
exit 1 |
389 |
fi |
390 |
|
391 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
392 |
++# PREFIX LOCAL: always support ED |
393 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
394 |
++# END PREFIX LOCAL |
395 |
+ |
396 |
if [[ ${2} == */ ]] || \ |
397 |
[[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then |
398 |
# implicit basename not allowed by PMS (bug #379899) |
399 |
@@@ -18,9 -20,7 +22,11 @@@ f |
400 |
destdir=${2%/*} |
401 |
[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}" |
402 |
|
403 |
-ln -snf "$1" "${ED}$2" |
404 |
++# PREFIX LOCAL: when absolute, prefix with offset |
405 |
+target="${1}" |
406 |
+[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}" |
407 |
- ln -snf "${target}" "${ED}/${2}" |
408 |
++ln -snf "${target}" "${ED}${2}" |
409 |
++# END PREFIX LOCAL |
410 |
ret=$? |
411 |
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed" |
412 |
exit $ret |
413 |
diff --cc bin/ebuild-helpers/ecompressdir |
414 |
index 3d5af2d,f9a846a..3219669 |
415 |
--- a/bin/ebuild-helpers/ecompressdir |
416 |
+++ b/bin/ebuild-helpers/ecompressdir |
417 |
@@@ -1,14 -1,16 +1,18 @@@ |
418 |
-#!/bin/bash |
419 |
+#!@PORTAGE_BASH@ |
420 |
- # Copyright 1999-2010 Gentoo Foundation |
421 |
+ # Copyright 1999-2011 Gentoo Foundation |
422 |
# Distributed under the terms of the GNU General Public License v2 |
423 |
|
424 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
425 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
426 |
|
427 |
if [[ -z $1 ]] ; then |
428 |
helpers_die "${0##*/}: at least one argument needed" |
429 |
exit 1 |
430 |
fi |
431 |
|
432 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
433 |
++# PREFIX LOCAL: always support ED |
434 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
435 |
++# END PREFIX LOCAL |
436 |
+ |
437 |
case $1 in |
438 |
--ignore) |
439 |
shift |
440 |
diff --cc bin/ebuild-helpers/fowners |
441 |
index 0c5295b,3f51b4e..5c1ecac |
442 |
--- a/bin/ebuild-helpers/fowners |
443 |
+++ b/bin/ebuild-helpers/fowners |
444 |
@@@ -1,14 -1,11 +1,18 @@@ |
445 |
-#!/bin/bash |
446 |
+#!@PORTAGE_BASH@ |
447 |
- # Copyright 1999-2010 Gentoo Foundation |
448 |
+ # Copyright 1999-2011 Gentoo Foundation |
449 |
# Distributed under the terms of the GNU General Public License v2 |
450 |
|
451 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
452 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
453 |
|
454 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
455 |
+if hasq prefix ${USE} && [[ $EUID != 0 ]] ; then |
456 |
+ ewarn "fowners ignored in Prefix with non-privileged user" |
457 |
+ exit 0 |
458 |
+fi |
459 |
+ |
460 |
++# PREFIX LOCAL: always support ED |
461 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
462 |
++# END PREFIX LOCAL |
463 |
+ |
464 |
# we can't prefix all arguments because |
465 |
# chown takes random options |
466 |
slash="/" |
467 |
diff --cc bin/ebuild-helpers/fperms |
468 |
index dec0b42,9a2971a..25f77a9 |
469 |
--- a/bin/ebuild-helpers/fperms |
470 |
+++ b/bin/ebuild-helpers/fperms |
471 |
@@@ -1,9 -1,10 +1,12 @@@ |
472 |
-#!/bin/bash |
473 |
+#!@PORTAGE_BASH@ |
474 |
- # Copyright 1999-2010 Gentoo Foundation |
475 |
+ # Copyright 1999-2011 Gentoo Foundation |
476 |
# Distributed under the terms of the GNU General Public License v2 |
477 |
|
478 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
479 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
480 |
|
481 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
482 |
++# PREFIX LOCAL: always support ED |
483 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
484 |
++# END PREFIX LOCAL |
485 |
# we can't prefix all arguments because |
486 |
# chmod takes random options |
487 |
slash="/" |
488 |
diff --cc bin/ebuild-helpers/prepall |
489 |
index a765756,611c4ce..c4e9ffc |
490 |
--- a/bin/ebuild-helpers/prepall |
491 |
+++ b/bin/ebuild-helpers/prepall |
492 |
@@@ -2,10 -2,10 +2,12 @@@ |
493 |
# Copyright 1999-2011 Gentoo Foundation |
494 |
# Distributed under the terms of the GNU General Public License v2 |
495 |
|
496 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
497 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
498 |
+ |
499 |
+[[ -d ${ED} ]] || exit 0 |
500 |
|
501 |
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac |
502 |
+ |
503 |
if has chflags $FEATURES ; then |
504 |
# Save all the file flags for restoration at the end of prepall. |
505 |
mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree" |
506 |
diff --cc bin/ebuild-helpers/prepalldocs |
507 |
index ab4166e,540d025..67a3d8f |
508 |
--- a/bin/ebuild-helpers/prepalldocs |
509 |
+++ b/bin/ebuild-helpers/prepalldocs |
510 |
@@@ -1,15 -1,16 +1,18 @@@ |
511 |
-#!/bin/bash |
512 |
+#!@PORTAGE_BASH@ |
513 |
- # Copyright 1999-2010 Gentoo Foundation |
514 |
+ # Copyright 1999-2011 Gentoo Foundation |
515 |
# Distributed under the terms of the GNU General Public License v2 |
516 |
|
517 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
518 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
519 |
|
520 |
if [[ -n $1 ]] ; then |
521 |
vecho "${0##*/}: invalid usage; takes no arguments" 1>&2 |
522 |
fi |
523 |
|
524 |
- cd "${D}" |
525 |
- [[ -d ${EPREFIX}usr/share/doc ]] || exit 0 |
526 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
527 |
++# PREFIX LOCAL: always support ED |
528 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
529 |
++# END PREFIX LOCAL |
530 |
+ |
531 |
+ [[ -d ${ED}usr/share/doc ]] || exit 0 |
532 |
|
533 |
ecompressdir --ignore /usr/share/doc/${PF}/html |
534 |
ecompressdir --queue /usr/share/doc |
535 |
diff --cc bin/ebuild-helpers/prepallinfo |
536 |
index 249e897,e351f87..2b1b5b4 |
537 |
--- a/bin/ebuild-helpers/prepallinfo |
538 |
+++ b/bin/ebuild-helpers/prepallinfo |
539 |
@@@ -1,7 -1,11 +1,13 @@@ |
540 |
-#!/bin/bash |
541 |
+#!@PORTAGE_BASH@ |
542 |
- # Copyright 1999-2006 Gentoo Foundation |
543 |
+ # Copyright 1999-2011 Gentoo Foundation |
544 |
# Distributed under the terms of the GNU General Public License v2 |
545 |
|
546 |
- [[ ! -d ${ED}usr/share/info ]] && exit 0 |
547 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
548 |
++source "${PORTAGE_BIN_PATH:-@PORTAGE_BIN_PATH@}"/isolated-functions.sh |
549 |
+ |
550 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
551 |
++# PREFIX LOCAL: always support ED |
552 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
553 |
++# END PREFIX LOCAL |
554 |
+ |
555 |
+ [[ -d ${ED}usr/share/info ]] || exit 0 |
556 |
|
557 |
exec prepinfo |
558 |
diff --cc bin/ebuild-helpers/prepallman |
559 |
index 19437dd,be7f194..a7bb30b |
560 |
--- a/bin/ebuild-helpers/prepallman |
561 |
+++ b/bin/ebuild-helpers/prepallman |
562 |
@@@ -7,10 -7,10 +7,16 @@@ source "${PORTAGE_BIN_PATH:-@PORTAGE_BA |
563 |
# replaced by controllable compression in EAPI 4 |
564 |
has "${EAPI}" 0 1 2 3 || exit 0 |
565 |
|
566 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
567 |
++# PREFIX LOCAL: always support ED |
568 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
569 |
++# END PREFIX LOCAL |
570 |
+ |
571 |
ret=0 |
572 |
|
573 |
++# PREFIX LOCAL: ED needs not to exist, wheras D does |
574 |
+[[ -d ${ED} ]] || exit ${ret} |
575 |
++# END PREFIX LOCAL |
576 |
+ |
577 |
find "${ED}" -type d -name man > "${T}"/prepallman.filelist |
578 |
while read -r mandir ; do |
579 |
mandir=${mandir#${ED}} |
580 |
diff --cc bin/ebuild-helpers/prepallstrip |
581 |
index 18ce4cc,e9f5f8e..b03c053 |
582 |
--- a/bin/ebuild-helpers/prepallstrip |
583 |
+++ b/bin/ebuild-helpers/prepallstrip |
584 |
@@@ -1,5 -1,7 +1,9 @@@ |
585 |
-#!/bin/bash |
586 |
+#!@PORTAGE_BASH@ |
587 |
- # Copyright 1999-2006 Gentoo Foundation |
588 |
+ # Copyright 1999-2011 Gentoo Foundation |
589 |
# Distributed under the terms of the GNU General Public License v2 |
590 |
|
591 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
592 |
++# PREFIX LOCAL: always support ED |
593 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
594 |
++# END PREFIX LOCAL |
595 |
+ |
596 |
exec prepstrip "${ED}" |
597 |
diff --cc bin/ebuild-helpers/prepinfo |
598 |
index c350fba,afe214c..c0ab9c9 |
599 |
--- a/bin/ebuild-helpers/prepinfo |
600 |
+++ b/bin/ebuild-helpers/prepinfo |
601 |
@@@ -2,15 -2,17 +2,19 @@@ |
602 |
# Copyright 1999-2011 Gentoo Foundation |
603 |
# Distributed under the terms of the GNU General Public License v2 |
604 |
|
605 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
606 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
607 |
|
608 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
609 |
++# PREFIX LOCAL: always support ED |
610 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
611 |
++# END PREFIX LOCAL |
612 |
+ |
613 |
if [[ -z $1 ]] ; then |
614 |
- infodir="${EPREFIX}/usr/share/info" |
615 |
+ infodir="/usr/share/info" |
616 |
else |
617 |
if [[ -d ${ED}$1/share/info ]] ; then |
618 |
- infodir="${EPREFIX}$1/share/info" |
619 |
+ infodir="$1/share/info" |
620 |
else |
621 |
- infodir="${EPREFIX}$1/info" |
622 |
+ infodir="$1/info" |
623 |
fi |
624 |
fi |
625 |
|
626 |
diff --cc bin/ebuild-helpers/preplib |
627 |
index 8b9e04d,8c62921..7090d0c |
628 |
--- a/bin/ebuild-helpers/preplib |
629 |
+++ b/bin/ebuild-helpers/preplib |
630 |
@@@ -1,11 -1,13 +1,15 @@@ |
631 |
-#!/bin/bash |
632 |
+#!@PORTAGE_BASH@ |
633 |
- # Copyright 1999-2006 Gentoo Foundation |
634 |
+ # Copyright 1999-2011 Gentoo Foundation |
635 |
# Distributed under the terms of the GNU General Public License v2 |
636 |
|
637 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
638 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
639 |
|
640 |
eqawarn "QA Notice: Deprecated call to 'preplib'" |
641 |
|
642 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
643 |
++# PREFIX LOCAL: always support ED |
644 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
645 |
++# END PREFIX LOCAL |
646 |
+ |
647 |
LIBDIR_VAR="LIBDIR_${ABI}" |
648 |
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then |
649 |
CONF_LIBDIR="${!LIBDIR_VAR}" |
650 |
diff --cc bin/ebuild-helpers/prepman |
651 |
index f8c670f,8ea7607..2c10b26 |
652 |
--- a/bin/ebuild-helpers/prepman |
653 |
+++ b/bin/ebuild-helpers/prepman |
654 |
@@@ -2,8 -2,10 +2,10 @@@ |
655 |
# Copyright 1999-2011 Gentoo Foundation |
656 |
# Distributed under the terms of the GNU General Public License v2 |
657 |
|
658 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
659 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh |
660 |
|
661 |
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac |
662 |
+ |
663 |
if [[ -z $1 ]] ; then |
664 |
mandir="${ED}usr/share/man" |
665 |
else |
666 |
diff --cc bin/ebuild-helpers/prepstrip |
667 |
index 0305f0a,fac20b2..927078a |
668 |
--- a/bin/ebuild-helpers/prepstrip |
669 |
+++ b/bin/ebuild-helpers/prepstrip |
670 |
@@@ -18,6 -18,8 +18,10 @@@ exp_tf() |
671 |
exp_tf FEATURES installsources nostrip splitdebug |
672 |
exp_tf RESTRICT binchecks installsources strip |
673 |
|
674 |
-case "$EAPI" in 0|1|2) ED=${D} ;; esac |
675 |
++# PREFIX LOCAL: always support ED |
676 |
++#case "$EAPI" in 0|1|2) ED=${D} ;; esac |
677 |
++# END PREFIX LOCAL |
678 |
+ |
679 |
banner=false |
680 |
SKIP_STRIP=false |
681 |
if ${RESTRICT_strip} || ${FEATURES_nostrip} ; then |
682 |
@@@ -99,7 -101,7 +103,9 @@@ save_elf_debug() |
683 |
${FEATURES_splitdebug} || return 0 |
684 |
|
685 |
local x=$1 |
686 |
- local y="${ED}usr/lib/debug/${x:${#ED}}.debug" |
687 |
++ # PREFIX LOCAL: keep offset path in debug location file |
688 |
+ local y="${ED}usr/lib/debug/${x:${#D}}.debug" |
689 |
++ # END PREFIX LOCAL |
690 |
|
691 |
# dont save debug info twice |
692 |
[[ ${x} == *".debug" ]] && return 0 |
693 |
@@@ -108,7 -110,7 +114,9 @@@ |
694 |
|
695 |
local inode=$(inode_var_name "$x") |
696 |
if [[ -n ${!inode} ]] ; then |
697 |
- ln "${ED}usr/lib/debug/${!inode:${#ED}}.debug" "$y" |
698 |
++ # PREFIX LOCAL: keep offset path in debug location file |
699 |
+ ln "${ED}usr/lib/debug/${!inode:${#D}}.debug" "$y" |
700 |
++ # END PREFIX LOCAL |
701 |
else |
702 |
eval $inode=\$x |
703 |
if [[ -e ${T}/prepstrip.split.debug ]] ; then |
704 |
diff --cc bin/ebuild.sh |
705 |
index 7952515,f39e536..2ec34cd |
706 |
--- a/bin/ebuild.sh |
707 |
+++ b/bin/ebuild.sh |
708 |
@@@ -2,23 -2,9 +2,9 @@@ |
709 |
# Copyright 1999-2011 Gentoo Foundation |
710 |
# Distributed under the terms of the GNU General Public License v2 |
711 |
|
712 |
-PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}" |
713 |
-PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}" |
714 |
+PORTAGE_BIN_PATH="${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}" |
715 |
+PORTAGE_PYM_PATH="${PORTAGE_PYM_PATH:-@PORTAGE_BASE@/pym}" |
716 |
|
717 |
- ROOTPATH=${ROOTPATH##:} |
718 |
- ROOTPATH=${ROOTPATH%%:} |
719 |
- PREROOTPATH=${PREROOTPATH##:} |
720 |
- PREROOTPATH=${PREROOTPATH%%:} |
721 |
- #PATH=$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin${ROOTPATH:+:}$ROOTPATH |
722 |
- # PREFIX: our DEFAULT_PATH is equal to the above when not using an |
723 |
- # offset prefix. With such prefix, the usr/local bits are excluded, and |
724 |
- # the prefixed variants of {usr/,}{s,}bin are taken. The additional |
725 |
- # paths given during configure, always come as last thing since they |
726 |
- # should never override anything from the prefix itself. |
727 |
- PATH="$PORTAGE_BIN_PATH/ebuild-helpers:$PREROOTPATH${PREROOTPATH:+:}${DEFAULT_PATH}${ROOTPATH:+:}$ROOTPATH${EXTRA_PATH:+:}${EXTRA_PATH}" |
728 |
- export PATH |
729 |
- |
730 |
- |
731 |
# Prevent aliases from causing portage to act inappropriately. |
732 |
# Make sure it's before everything so we don't mess aliases that follow. |
733 |
unalias -a |
734 |
diff --cc bin/isolated-functions.sh |
735 |
index 12edfbc,d2ea319..d9e4649 |
736 |
--- a/bin/isolated-functions.sh |
737 |
+++ b/bin/isolated-functions.sh |
738 |
@@@ -436,36 -438,25 +440,31 @@@ RC_INDENTATION=' |
739 |
RC_DEFAULT_INDENT=2 |
740 |
RC_DOT_PATTERN='' |
741 |
|
742 |
- if [[ $EBUILD_PHASE == depend ]] ; then |
743 |
- # avoid unneeded stty call in set_colors during "depend" phase |
744 |
- unset_colors |
745 |
- else |
746 |
- case "${NOCOLOR:-false}" in |
747 |
- yes|true) |
748 |
- unset_colors |
749 |
- ;; |
750 |
- no|false) |
751 |
- set_colors |
752 |
- ;; |
753 |
- esac |
754 |
- fi |
755 |
+ case "${NOCOLOR:-false}" in |
756 |
+ yes|true) |
757 |
+ unset_colors |
758 |
+ ;; |
759 |
+ no|false) |
760 |
+ set_colors |
761 |
+ ;; |
762 |
+ esac |
763 |
|
764 |
-if [[ -z ${USERLAND} ]] ; then |
765 |
- case $(uname -s) in |
766 |
- *BSD|DragonFly) |
767 |
- export USERLAND="BSD" |
768 |
- ;; |
769 |
- *) |
770 |
- export USERLAND="GNU" |
771 |
- ;; |
772 |
- esac |
773 |
-fi |
774 |
+# In Prefix every platform has USERLAND=GNU, even FreeBSD. Since I |
775 |
+# don't know how to reliably "figure out" we are in a Prefix instance of |
776 |
+# portage here, I for now disable this check, and hardcode it to GNU. |
777 |
+# Somehow it appears stange to me that this code is in this file, |
778 |
+# non-ebuilds/eclasses should never rely on USERLAND and XARGS, don't they? |
779 |
+#if [[ -z ${USERLAND} ]] ; then |
780 |
+# case $(uname -s) in |
781 |
+# *BSD|DragonFly) |
782 |
+# export USERLAND="BSD" |
783 |
+# ;; |
784 |
+# *) |
785 |
+# export USERLAND="GNU" |
786 |
+# ;; |
787 |
+# esac |
788 |
+#fi |
789 |
+[[ -z ${USERLAND} ]] && USERLAND="GNU" |
790 |
|
791 |
if [[ -z ${XARGS} ]] ; then |
792 |
case ${USERLAND} in |
793 |
diff --cc bin/misc-functions.sh |
794 |
index b093382,1c11dc5..58f5bc8 |
795 |
mode 100644,100755..100644 |
796 |
--- a/bin/misc-functions.sh |
797 |
+++ b/bin/misc-functions.sh |
798 |
@@@ -14,12 -14,11 +14,16 @@@ |
799 |
MISC_FUNCTIONS_ARGS="$@" |
800 |
shift $# |
801 |
|
802 |
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh" |
803 |
+source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}/ebuild.sh" |
804 |
|
805 |
install_symlink_html_docs() { |
806 |
- cd "${D}" || die "cd failed" |
807 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
808 |
++ # PREFIX LOCAL: always support ED |
809 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
810 |
++ # END PREFIX LOCAL |
811 |
++ # PREFIX LOCAL: ED need not to exist, whereas D does |
812 |
+ [[ ! -d ${ED} ]] && dodir / |
813 |
- cd "${ED}" || die "cd shouldn't have failed" |
814 |
++ # END PREFIX LOCAL |
815 |
+ cd "${ED}" || die "cd failed" |
816 |
#symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf) |
817 |
if [ -n "${DOC_SYMLINKS_DIR}" ] ; then |
818 |
local mydocdir docdir |
819 |
@@@ -147,8 -147,9 +152,13 @@@ prepcompress() |
820 |
|
821 |
install_qa_check() { |
822 |
local f i x |
823 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
824 |
++ # PREFIX LOCAL: always support ED |
825 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
826 |
++ # END PREFIX LOCAL |
827 |
|
828 |
- cd "${ED}" || die "cd failed" |
829 |
++ # PREFIX LOCAL: ED needs not to exist, whereas D does |
830 |
+ cd "${D}" || die "cd failed" |
831 |
++ # END PREFIX LOCAL |
832 |
|
833 |
export STRIP_MASK |
834 |
prepall |
835 |
@@@ -177,40 -181,6 +190,37 @@@ |
836 |
sleep 1 |
837 |
fi |
838 |
|
839 |
+ # anything outside the prefix should be caught by the Prefix QA |
840 |
+ # check, so if there's nothing in ED, we skip searching for QA |
841 |
+ # checks there, the specific QA funcs can hence rely on ED existing |
842 |
+ if [[ -d ${ED} ]] ; then |
843 |
+ case ${CHOST} in |
844 |
+ *-darwin*) |
845 |
+ # Mach-O platforms (NeXT, Darwin, OSX) |
846 |
+ install_qa_check_macho |
847 |
+ ;; |
848 |
+ *-interix*|*-winnt*) |
849 |
+ # PECOFF platforms (Windows/Interix) |
850 |
+ install_qa_check_pecoff |
851 |
+ ;; |
852 |
+ *-aix*) |
853 |
+ # XCOFF platforms (AIX) |
854 |
+ install_qa_check_xcoff |
855 |
+ ;; |
856 |
+ *) |
857 |
+ # because this is the majority: ELF platforms (Linux, |
858 |
+ # Solaris, *BSD, IRIX, etc.) |
859 |
+ install_qa_check_elf |
860 |
+ ;; |
861 |
+ esac |
862 |
+ fi |
863 |
+ |
864 |
+ # this is basically here such that the diff with trunk remains just |
865 |
+ # offsetted and not out of order |
866 |
+ install_qa_check_misc |
867 |
- |
868 |
- # Prefix specific checks |
869 |
- [[ -n ${EPREFIX} ]] && install_qa_check_prefix |
870 |
+} |
871 |
+ |
872 |
+install_qa_check_elf() { |
873 |
if type -P scanelf > /dev/null && ! has binchecks ${RESTRICT}; then |
874 |
local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET} |
875 |
local x |
876 |
@@@ -339,8 -309,6 +349,7 @@@ |
877 |
if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && [[ "${PN}" != *-bin ]] ; then |
878 |
qa_var="QA_DT_HASH_${ARCH/-/_}" |
879 |
eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")" |
880 |
- # use ED here, for the rest of the checks of scanelf's |
881 |
- # output, scanelf is silent on non-existing ED |
882 |
++ |
883 |
f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::") |
884 |
if [[ -n ${f} ]] ; then |
885 |
echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log |
886 |
@@@ -457,7 -425,7 +466,9 @@@ |
887 |
# Check for shared libraries lacking NEEDED entries |
888 |
qa_var="QA_DT_NEEDED_${ARCH/-/_}" |
889 |
eval "[[ -n \${!qa_var} ]] && QA_DT_NEEDED=(\"\${${qa_var}[@]}\")" |
890 |
- f=$(scanelf -ByF '%n %p' "${ED}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${ED}:/:") |
891 |
++ # PREFIX LOCAL: keep offset prefix in the recorded files |
892 |
+ f=$(scanelf -ByF '%n %p' "${ED}"{,usr/}lib*/lib*.so* | gawk '$2 == "" { print }' | sed -e "s:^[[:space:]]${D}:/:") |
893 |
++ # END PREFIX LOCAL |
894 |
if [[ -n ${f} ]] ; then |
895 |
echo "${f}" > "${T}"/scanelf-missing-NEEDED.log |
896 |
if [[ "${QA_STRICT_DT_NEEDED-unset}" == unset ]] ; then |
897 |
@@@ -490,10 -458,8 +501,12 @@@ |
898 |
|
899 |
PORTAGE_QUIET=${tmp_quiet} |
900 |
fi |
901 |
+} |
902 |
|
903 |
- local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${ED}:/:") |
904 |
+install_qa_check_misc() { |
905 |
- local unsafe_files=$(find "${D}" -type f '(' -perm -2002 -o -perm -4002 ')') |
906 |
++ # PREFIX LOCAL: keep offset prefix in the reported files |
907 |
++ local unsafe_files=$(find "${ED}" -type f '(' -perm -2002 -o -perm -4002 ')' | sed -e "s:^${D}:/:") |
908 |
++ # END PREFIX LOCAL |
909 |
if [[ -n ${unsafe_files} ]] ; then |
910 |
eqawarn "QA Notice: Unsafe files detected (set*id and world writable)" |
911 |
eqawarn "${unsafe_files}" |
912 |
@@@ -566,9 -534,7 +579,11 @@@ |
913 |
abort="no" |
914 |
local a s |
915 |
for a in "${ED}"usr/lib*/*.a ; do |
916 |
- s=${a%.a}.so |
917 |
++ # PREFIX LOCAL: support MachO objects |
918 |
+ [[ ${CHOST} == *-darwin* ]] \ |
919 |
+ && s=${a%.a}.dylib \ |
920 |
+ || s=${a%.a}.so |
921 |
++ # END PREFIX LOCAL |
922 |
if [[ ! -e ${s} ]] ; then |
923 |
s=${s%usr/*}${s##*/usr/} |
924 |
if [[ -e ${s} ]] ; then |
925 |
@@@ -581,11 -547,7 +596,12 @@@ |
926 |
[[ ${abort} == "yes" ]] && die "add those ldscripts" |
927 |
|
928 |
# Make sure people don't store libtool files or static libs in /lib |
929 |
- # on AIX, "dynamic libs" have extension .a, so don't get false |
930 |
- # positives |
931 |
- f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null) |
932 |
++ # PREFIX LOCAL: on AIX, "dynamic libs" have extension .a, so don't |
933 |
++ # get false positives |
934 |
+ [[ ${CHOST} == *-aix* ]] \ |
935 |
+ && f=$(ls "${ED}"lib*/*.la 2>/dev/null || true) \ |
936 |
+ || f=$(ls "${ED}"lib*/*.{a,la} 2>/dev/null) |
937 |
++ # END PREFIX LOCAL |
938 |
if [[ -n ${f} ]] ; then |
939 |
vecho -ne '\n' |
940 |
eqawarn "QA Notice: Excessive files found in the / partition" |
941 |
@@@ -894,372 -856,6 +910,371 @@@ install_qa_check_prefix() |
942 |
fi |
943 |
} |
944 |
|
945 |
+install_qa_check_macho() { |
946 |
+ if ! has binchecks ${RESTRICT} ; then |
947 |
+ # on Darwin, dynamic libraries are called .dylibs instead of |
948 |
+ # .sos. In addition the version component is before the |
949 |
+ # extension, not after it. Check for this, and *only* warn |
950 |
+ # about it. Some packages do ship .so files on Darwin and make |
951 |
+ # it work (ugly!). |
952 |
+ rm -f "${T}/mach-o.check" |
953 |
+ find ${ED%/} -name "*.so" -or -name "*.so.*" | \ |
954 |
+ while read i ; do |
955 |
+ [[ $(file $i) == *"Mach-O"* ]] && \ |
956 |
+ echo "${i#${D}}" >> "${T}/mach-o.check" |
957 |
+ done |
958 |
+ if [[ -f ${T}/mach-o.check ]] ; then |
959 |
+ f=$(< "${T}/mach-o.check") |
960 |
+ vecho -ne '\a\n' |
961 |
+ eqawarn "QA Notice: Found .so dynamic libraries on Darwin:" |
962 |
+ eqawarn " ${f//$'\n'/\n }" |
963 |
+ fi |
964 |
+ rm -f "${T}/mach-o.check" |
965 |
+ |
966 |
+ # The naming for dynamic libraries is different on Darwin; the |
967 |
+ # version component is before the extention, instead of after |
968 |
+ # it, as with .sos. Again, make this a warning only. |
969 |
+ rm -f "${T}/mach-o.check" |
970 |
+ find ${ED%/} -name "*.dylib.*" | \ |
971 |
+ while read i ; do |
972 |
+ echo "${i#${D}}" >> "${T}/mach-o.check" |
973 |
+ done |
974 |
+ if [[ -f "${T}/mach-o.check" ]] ; then |
975 |
+ f=$(< "${T}/mach-o.check") |
976 |
+ vecho -ne '\a\n' |
977 |
+ eqawarn "QA Notice: Found wrongly named dynamic libraries on Darwin:" |
978 |
+ eqawarn " ${f// /\n }" |
979 |
+ fi |
980 |
+ rm -f "${T}/mach-o.check" |
981 |
+ fi |
982 |
+ |
983 |
+ # While we generate the NEEDED files, check that we don't get kernel |
984 |
+ # traps at runtime because of broken install_names on Darwin. |
985 |
+ rm -f "${T}"/.install_name_check_failed |
986 |
+ scanmacho -qyRF '%a;%p;%S;%n' "${D}" | { while IFS= read l ; do |
987 |
+ arch=${l%%;*}; l=${l#*;} |
988 |
+ obj="/${l%%;*}"; l=${l#*;} |
989 |
+ install_name=${l%%;*}; l=${l#*;} |
990 |
+ needed=${l%%;*}; l=${l#*;} |
991 |
+ |
992 |
+ # See if the self-reference install_name points to an existing |
993 |
+ # and to be installed file. This usually is a symlink for the |
994 |
+ # major version. |
995 |
+ if [[ ! -e ${D}${install_name} ]] ; then |
996 |
+ eqawarn "QA Notice: invalid self-reference install_name ${install_name} in ${obj}" |
997 |
+ # remember we are in an implicit subshell, that's |
998 |
+ # why we touch a file here ... ideally we should be |
999 |
+ # able to die correctly/nicely here |
1000 |
+ touch "${T}"/.install_name_check_failed |
1001 |
+ fi |
1002 |
+ |
1003 |
+ # this is ugly, paths with spaces won't work |
1004 |
+ reevaluate=0 |
1005 |
+ for lib in ${needed//,/ } ; do |
1006 |
+ if [[ ${lib} == ${D}* ]] ; then |
1007 |
+ eqawarn "QA Notice: install_name references \${D}: ${lib} in ${obj}" |
1008 |
+ touch "${T}"/.install_name_check_failed |
1009 |
+ elif [[ ${lib} == ${S}* ]] ; then |
1010 |
+ eqawarn "QA Notice: install_name references \${S}: ${lib} in ${obj}" |
1011 |
+ touch "${T}"/.install_name_check_failed |
1012 |
+ elif [[ ! -e ${lib} && ! -e ${D}${lib} && ${lib} != "@executable_path/"* && ${lib} != "@loader_path/"* ]] ; then |
1013 |
+ # try to "repair" this if possible, happens because of |
1014 |
+ # gen_usr_ldscript tactics |
1015 |
+ s=${lib%usr/*}${lib##*/usr/} |
1016 |
+ if [[ -e ${D}${s} ]] ; then |
1017 |
+ ewarn "correcting install_name from ${lib} to ${s} in ${obj}" |
1018 |
+ install_name_tool -change \ |
1019 |
+ "${lib}" "${s}" "${D}${obj}" |
1020 |
+ reevaluate=1 |
1021 |
+ else |
1022 |
+ eqawarn "QA Notice: invalid reference to ${lib} in ${obj}" |
1023 |
+ # remember we are in an implicit subshell, that's |
1024 |
+ # why we touch a file here ... ideally we should be |
1025 |
+ # able to die correctly/nicely here |
1026 |
+ touch "${T}"/.install_name_check_failed |
1027 |
+ fi |
1028 |
+ fi |
1029 |
+ done |
1030 |
+ if [[ ${reevaluate} == 1 ]]; then |
1031 |
+ # install_name(s) have been changed, refresh data so we |
1032 |
+ # store the correct meta data |
1033 |
+ l=$(scanmacho -qyF '%a;%p;%S;%n' ${D}${obj}) |
1034 |
+ arch=${l%%;*}; l=${l#*;} |
1035 |
+ obj="/${l%%;*}"; l=${l#*;} |
1036 |
+ install_name=${l%%;*}; l=${l#*;} |
1037 |
+ needed=${l%%;*}; l=${l#*;} |
1038 |
+ fi |
1039 |
+ |
1040 |
+ # backwards compatability |
1041 |
+ echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
1042 |
+ # what we use |
1043 |
+ echo "${arch};${obj};${install_name};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.MACHO.3 |
1044 |
+ done } |
1045 |
+ if [[ -f ${T}/.install_name_check_failed ]] ; then |
1046 |
+ # secret switch "allow_broken_install_names" to get |
1047 |
+ # around this and install broken crap (not a good idea) |
1048 |
+ has allow_broken_install_names ${FEATURES} || \ |
1049 |
+ die "invalid install_name found, your application or library will crash at runtime" |
1050 |
+ fi |
1051 |
+} |
1052 |
+ |
1053 |
+install_qa_check_pecoff() { |
1054 |
+ local _pfx_scan="readpecoff ${CHOST}" |
1055 |
+ |
1056 |
+ # this one uses readpecoff, which supports multiple prefix platforms! |
1057 |
+ # this is absolutely _not_ optimized for speed, and there may be plenty |
1058 |
+ # of possibilities by introducing one or the other cache! |
1059 |
+ if ! has binchecks ${RESTRICT}; then |
1060 |
+ # copied and adapted from the above scanelf code. |
1061 |
+ local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET} |
1062 |
+ local f x |
1063 |
+ |
1064 |
+ # display warnings when using stricter because we die afterwards |
1065 |
+ if has stricter ${FEATURES} ; then |
1066 |
+ unset PORTAGE_QUIET |
1067 |
+ fi |
1068 |
+ |
1069 |
+ local _exec_find_opt="-executable" |
1070 |
+ [[ ${CHOST} == *-winnt* ]] && _exec_find_opt='-name *.dll -o -name *.exe' |
1071 |
+ |
1072 |
+ # Make sure we disallow insecure RUNPATH/RPATH's |
1073 |
+ # Don't want paths that point to the tree where the package was built |
1074 |
+ # (older, broken libtools would do this). Also check for null paths |
1075 |
+ # because the loader will search $PWD when it finds null paths. |
1076 |
+ |
1077 |
+ f=$( |
1078 |
+ find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | \ |
1079 |
+ while IFS=";" read arch obj soname rpath needed ; do \ |
1080 |
+ echo "${rpath}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )" > /dev/null 2>&1 \ |
1081 |
+ && echo "${obj}"; done; |
1082 |
+ ) |
1083 |
+ # Reject set*id binaries with $ORIGIN in RPATH #260331 |
1084 |
+ x=$( |
1085 |
+ find "${ED}" -type f '(' -perm -u+s -o -perm -g+s ')' -print0 | \ |
1086 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; do \ |
1087 |
+ echo "${rpath}" | grep '$ORIGIN' > /dev/null 2>&1 && echo "${obj}"; done; |
1088 |
+ ) |
1089 |
+ if [[ -n ${f}${x} ]] ; then |
1090 |
+ vecho -ne '\a\n' |
1091 |
+ eqawarn "QA Notice: The following files contain insecure RUNPATH's" |
1092 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
1093 |
+ eqawarn " with the maintaining herd of the package." |
1094 |
+ eqawarn "${f}${f:+${x:+\n}}${x}" |
1095 |
+ vecho -ne '\a\n' |
1096 |
+ if [[ -n ${x} ]] || has stricter ${FEATURES} ; then |
1097 |
+ insecure_rpath=1 |
1098 |
+ else |
1099 |
+ eqawarn "cannot automatically fix runpaths on interix platforms!" |
1100 |
+ fi |
1101 |
+ fi |
1102 |
+ |
1103 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
1104 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
1105 |
+ |
1106 |
+ # Save NEEDED information after removing self-contained providers |
1107 |
+ find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | { while IFS=';' read arch obj soname rpath needed; do |
1108 |
+ # need to strip image dir from object name. |
1109 |
+ obj="/${obj#${D}}" |
1110 |
+ if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then |
1111 |
+ # object doesn't contain $ORIGIN in its runpath attribute |
1112 |
+ echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
1113 |
+ echo "${arch};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
1114 |
+ else |
1115 |
+ dir=${obj%/*} |
1116 |
+ # replace $ORIGIN with the dirname of the current object for the lookup |
1117 |
+ opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#") |
1118 |
+ sneeded=$(echo ${needed} | tr , ' ') |
1119 |
+ rneeded="" |
1120 |
+ for lib in ${sneeded}; do |
1121 |
+ found=0 |
1122 |
+ for path in ${opath//:/ }; do |
1123 |
+ [ -e "${ED}/${path}/${lib}" ] && found=1 && break |
1124 |
+ done |
1125 |
+ [ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}" |
1126 |
+ done |
1127 |
+ rneeded=${rneeded:1} |
1128 |
+ if [ -n "${rneeded}" ]; then |
1129 |
+ echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
1130 |
+ echo "${arch};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
1131 |
+ fi |
1132 |
+ fi |
1133 |
+ done } |
1134 |
+ |
1135 |
+ if [[ ${insecure_rpath} -eq 1 ]] ; then |
1136 |
+ die "Aborting due to serious QA concerns with RUNPATH/RPATH" |
1137 |
+ elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then |
1138 |
+ die "Aborting due to QA concerns: ${die_msg}" |
1139 |
+ fi |
1140 |
+ |
1141 |
+ local _so_ext='.so*' |
1142 |
+ |
1143 |
+ case "${CHOST}" in |
1144 |
+ *-winnt*) _so_ext=".dll" ;; # no "*" intentionally! |
1145 |
+ esac |
1146 |
+ |
1147 |
+ # Run some sanity checks on shared libraries |
1148 |
+ for d in "${ED}"lib* "${ED}"usr/lib* ; do |
1149 |
+ [[ -d "${d}" ]] || continue |
1150 |
+ f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \ |
1151 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \ |
1152 |
+ do [[ -z "${soname}" ]] && echo "${obj}"; done) |
1153 |
+ if [[ -n ${f} ]] ; then |
1154 |
+ vecho -ne '\a\n' |
1155 |
+ eqawarn "QA Notice: The following shared libraries lack a SONAME" |
1156 |
+ eqawarn "${f}" |
1157 |
+ vecho -ne '\a\n' |
1158 |
+ sleep 1 |
1159 |
+ fi |
1160 |
+ |
1161 |
+ f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \ |
1162 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \ |
1163 |
+ do [[ -z "${needed}" ]] && echo "${obj}"; done) |
1164 |
+ if [[ -n ${f} ]] ; then |
1165 |
+ vecho -ne '\a\n' |
1166 |
+ eqawarn "QA Notice: The following shared libraries lack NEEDED entries" |
1167 |
+ eqawarn "${f}" |
1168 |
+ vecho -ne '\a\n' |
1169 |
+ sleep 1 |
1170 |
+ fi |
1171 |
+ done |
1172 |
+ |
1173 |
+ PORTAGE_QUIET=${tmp_quiet} |
1174 |
+ fi |
1175 |
+} |
1176 |
+ |
1177 |
+install_qa_check_xcoff() { |
1178 |
+ if ! has binchecks ${RESTRICT}; then |
1179 |
+ local tmp_quiet=${PORTAGE_QUIET} |
1180 |
+ local queryline deplib |
1181 |
+ local insecure_rpath_list= undefined_symbols_list= |
1182 |
+ |
1183 |
+ # display warnings when using stricter because we die afterwards |
1184 |
+ if has stricter ${FEATURES} ; then |
1185 |
+ unset PORTAGE_QUIET |
1186 |
+ fi |
1187 |
+ |
1188 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 |
1189 |
+ |
1190 |
+ local neededfd |
1191 |
+ for neededfd in {3..1024} none; do ( : <&${neededfd} ) 2>/dev/null || break; done |
1192 |
+ [[ ${neededfd} != none ]] || die "cannot find free file descriptor handle" |
1193 |
+ |
1194 |
+ eval "exec ${neededfd}>\"${PORTAGE_BUILDDIR}\"/build-info/NEEDED.XCOFF.1" || die "cannot open ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1" |
1195 |
+ |
1196 |
+ ( # work around a problem in /usr/bin/dump (used by aixdll-query) |
1197 |
+ # dumping core when path names get too long. |
1198 |
+ cd "${ED}" >/dev/null && |
1199 |
+ find . -not -type d -exec \ |
1200 |
+ aixdll-query '{}' FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS ';' |
1201 |
+ ) > "${T}"/needed 2>/dev/null |
1202 |
+ |
1203 |
+ # Symlinking shared archive libraries is not a good idea on aix, |
1204 |
+ # as there is nothing like "soname" on pure filesystem level. |
1205 |
+ # So we create a copy instead of the symlink. |
1206 |
+ local prev_FILE= |
1207 |
+ local FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS |
1208 |
+ while read queryline |
1209 |
+ do |
1210 |
+ FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS= |
1211 |
+ eval ${queryline} |
1212 |
+ FILE=${FILE#./} |
1213 |
+ |
1214 |
+ if [[ ${prev_FILE} != ${FILE} ]]; then |
1215 |
+ if [[ " ${FLAGS} " == *" SHROBJ "* && -h ${ED}${FILE} ]]; then |
1216 |
+ prev_FILE=${FILE} |
1217 |
+ local target=$(readlink "${ED}${FILE}") |
1218 |
+ if [[ ${target} == /* ]]; then |
1219 |
+ target=${D}${target} |
1220 |
+ else |
1221 |
+ target=${FILE%/*}/${target} |
1222 |
+ fi |
1223 |
+ rm -f "${ED}${FILE}" || die "cannot prune ${FILE}" |
1224 |
+ cp -f "${ED}${target}" "${ED}${FILE}" || die "cannot copy ${target} to ${FILE}" |
1225 |
+ fi |
1226 |
+ fi |
1227 |
+ done <"${T}"/needed |
1228 |
+ |
1229 |
+ prev_FILE= |
1230 |
+ while read queryline |
1231 |
+ do |
1232 |
+ FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS= |
1233 |
+ eval ${queryline} |
1234 |
+ FILE=${FILE#./} |
1235 |
+ |
1236 |
+ if [[ -n ${MEMBER} && ${prev_FILE} != ${FILE} ]]; then |
1237 |
+ # Save NEEDED information for each archive library stub |
1238 |
+ # even if it is static only: the already installed archive |
1239 |
+ # may contain shared objects to be preserved. |
1240 |
+ echo "${FORMAT##* }${FORMAT%%-*};${EPREFIX}/${FILE};${FILE##*/};;" >&${neededfd} |
1241 |
+ fi |
1242 |
+ prev_FILE=${FILE} |
1243 |
+ |
1244 |
+ # shared objects have both EXEC and SHROBJ flags, |
1245 |
+ # while executables have EXEC flag only. |
1246 |
+ [[ " ${FLAGS} " == *" EXEC "* ]] || continue |
1247 |
+ |
1248 |
+ # Make sure we disallow insecure RUNPATH's |
1249 |
+ # Don't want paths that point to the tree where the package was built |
1250 |
+ # (older, broken libtools would do this). Also check for null paths |
1251 |
+ # because the loader will search $PWD when it finds null paths. |
1252 |
+ # And we really want absolute paths only. |
1253 |
+ if [[ -n $(echo ":${RUNPATH}:" | grep -E "(${PORTAGE_BUILDDIR}|::|:[^/])") ]]; then |
1254 |
+ insecure_rpath_list="${insecure_rpath_list}\n${FILE}${MEMBER:+[${MEMBER}]}" |
1255 |
+ fi |
1256 |
+ |
1257 |
+ local needed= |
1258 |
+ [[ -n ${MEMBER} ]] && needed=${FILE##*/} |
1259 |
+ for deplib in ${DEPLIBS}; do |
1260 |
+ eval deplib=${deplib} |
1261 |
+ if [[ ${deplib} == '.' || ${deplib} == '..' ]]; then |
1262 |
+ # Although we do have runtime linking, we don't want undefined symbols. |
1263 |
+ # AIX does indicate this by needing either '.' or '..' |
1264 |
+ undefined_symbols_list="${undefined_symbols_list}\n${FILE}" |
1265 |
+ else |
1266 |
+ needed="${needed}${needed:+,}${deplib}" |
1267 |
+ fi |
1268 |
+ done |
1269 |
+ |
1270 |
+ FILE=${EPREFIX}/${FILE} |
1271 |
+ |
1272 |
+ [[ -n ${MEMBER} ]] && MEMBER="[${MEMBER}]" |
1273 |
+ # Save NEEDED information |
1274 |
+ echo "${FORMAT##* }${FORMAT%%-*};${FILE}${MEMBER};${FILE##*/}${MEMBER};${RUNPATH};${needed}" >&${neededfd} |
1275 |
+ done <"${T}"/needed |
1276 |
+ |
1277 |
+ eval "exec ${neededfd}>&-" || die "cannot close handle to ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1" |
1278 |
+ |
1279 |
+ if [[ -n ${undefined_symbols_list} ]]; then |
1280 |
+ vecho -ne '\a\n' |
1281 |
+ eqawarn "QA Notice: The following files contain undefined symbols." |
1282 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
1283 |
+ eqawarn " with 'prefix' as the maintaining herd of the package." |
1284 |
+ eqawarn "${undefined_symbols_list}" |
1285 |
+ vecho -ne '\a\n' |
1286 |
+ fi |
1287 |
+ |
1288 |
+ if [[ -n ${insecure_rpath_list} ]] ; then |
1289 |
+ vecho -ne '\a\n' |
1290 |
+ eqawarn "QA Notice: The following files contain insecure RUNPATH's" |
1291 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
1292 |
+ eqawarn " with 'prefix' as the maintaining herd of the package." |
1293 |
+ eqawarn "${insecure_rpath_list}" |
1294 |
+ vecho -ne '\a\n' |
1295 |
+ if has stricter ${FEATURES} ; then |
1296 |
+ insecure_rpath=1 |
1297 |
+ fi |
1298 |
+ fi |
1299 |
+ |
1300 |
+ if [[ ${insecure_rpath} -eq 1 ]] ; then |
1301 |
+ die "Aborting due to serious QA concerns with RUNPATH/RPATH" |
1302 |
+ elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then |
1303 |
+ die "Aborting due to QA concerns: ${die_msg}" |
1304 |
+ fi |
1305 |
+ |
1306 |
+ PORTAGE_QUIET=${tmp_quiet} |
1307 |
+ fi |
1308 |
+} |
1309 |
+ |
1310 |
- |
1311 |
install_mask() { |
1312 |
local root="$1" |
1313 |
shift |
1314 |
diff --cc bin/phase-helpers.sh |
1315 |
index 04cc291,04cf35a..ad469ed |
1316 |
--- a/bin/phase-helpers.sh |
1317 |
+++ b/bin/phase-helpers.sh |
1318 |
@@@ -19,6 -19,7 +19,9 @@@ into() |
1319 |
export DESTTREE="" |
1320 |
else |
1321 |
export DESTTREE=$1 |
1322 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1323 |
++ # PREFIX LOCAL: always support ED |
1324 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1325 |
++ # END PREFIX LOCAL |
1326 |
if [ ! -d "${ED}${DESTTREE}" ]; then |
1327 |
install -d "${ED}${DESTTREE}" |
1328 |
local ret=$? |
1329 |
@@@ -35,6 -36,7 +38,9 @@@ insinto() |
1330 |
export INSDESTTREE="" |
1331 |
else |
1332 |
export INSDESTTREE=$1 |
1333 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1334 |
++ # PREFIX LOCAL: always support ED |
1335 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1336 |
++ # END PREFIX LOCAL |
1337 |
if [ ! -d "${ED}${INSDESTTREE}" ]; then |
1338 |
install -d "${ED}${INSDESTTREE}" |
1339 |
local ret=$? |
1340 |
@@@ -51,6 -53,7 +57,9 @@@ exeinto() |
1341 |
export _E_EXEDESTTREE_="" |
1342 |
else |
1343 |
export _E_EXEDESTTREE_="$1" |
1344 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1345 |
++ # PREFIX LOCAL: always support ED |
1346 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1347 |
++ # END PREFIX LOCAL |
1348 |
if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then |
1349 |
install -d "${ED}${_E_EXEDESTTREE_}" |
1350 |
local ret=$? |
1351 |
@@@ -67,6 -70,7 +76,9 @@@ docinto() |
1352 |
export _E_DOCDESTTREE_="" |
1353 |
else |
1354 |
export _E_DOCDESTTREE_="$1" |
1355 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1356 |
++ # PREFIX LOCAL: always support ED |
1357 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1358 |
++ # END PREFIX LOCAL |
1359 |
if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then |
1360 |
install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" |
1361 |
local ret=$? |
1362 |
@@@ -133,6 -137,7 +145,9 @@@ docompress() |
1363 |
keepdir() { |
1364 |
dodir "$@" |
1365 |
local x |
1366 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1367 |
++ # PREFIX LOCAL: always support ED |
1368 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1369 |
++ # END PREFIX LOCAL |
1370 |
if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then |
1371 |
shift |
1372 |
find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" \ |
1373 |
@@@ -369,6 -374,8 +384,10 @@@ unpack() |
1374 |
econf() { |
1375 |
local x |
1376 |
|
1377 |
- case "$EAPI" in 0|1|2) local EPREFIX= ;; esac |
1378 |
++ # PREFIX LOCAL: always support EPREFIX |
1379 |
++ #case "$EAPI" in 0|1|2) local EPREFIX= ;; esac |
1380 |
++ # END PREFIX LOCAL |
1381 |
+ |
1382 |
_hasg() { |
1383 |
local x s=$1 |
1384 |
shift |
1385 |
@@@ -463,6 -470,7 +482,9 @@@ |
1386 |
einstall() { |
1387 |
# CONF_PREFIX is only set if they didn't pass in libdir above. |
1388 |
local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}" |
1389 |
- case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1390 |
++ # PREFIX LOCAL: always support ED |
1391 |
++ #case "$EAPI" in 0|1|2) local ED=${D} ;; esac |
1392 |
++ # END PREFIX LOCAL |
1393 |
LIBDIR_VAR="LIBDIR_${ABI}" |
1394 |
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then |
1395 |
CONF_LIBDIR="${!LIBDIR_VAR}" |
1396 |
@@@ -581,15 -589,28 +603,30 @@@ _eapi4_src_install() |
1397 |
fi |
1398 |
} |
1399 |
|
1400 |
+ # @FUNCTION: has_version |
1401 |
+ # @USAGE: <DEPEND ATOM> |
1402 |
+ # @DESCRIPTION: |
1403 |
# Return true if given package is installed. Otherwise return false. |
1404 |
- # Takes single depend-type atoms. |
1405 |
+ # Callers may override the ROOT variable in order to match packages from an |
1406 |
+ # alternative ROOT. |
1407 |
has_version() { |
1408 |
|
1409 |
+ local eroot |
1410 |
+ case "$EAPI" in |
1411 |
- 0|1|2) |
1412 |
- eroot=${ROOT} |
1413 |
- ;; |
1414 |
++ # PREFIX LOCAL: always support ED |
1415 |
++ #0|1|2) |
1416 |
++ # eroot=${ROOT} |
1417 |
++ # ;; |
1418 |
++ # END PREFIX LOCAL |
1419 |
+ *) |
1420 |
+ eroot=${ROOT%/}${EPREFIX}/ |
1421 |
+ ;; |
1422 |
+ esac |
1423 |
if [[ -n $PORTAGE_IPC_DAEMON ]] ; then |
1424 |
- "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" |
1425 |
+ "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1" |
1426 |
else |
1427 |
PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ |
1428 |
- "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" |
1429 |
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1" |
1430 |
++ "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1" |
1431 |
fi |
1432 |
local retval=$? |
1433 |
case "${retval}" in |
1434 |
@@@ -602,15 -623,28 +639,30 @@@ |
1435 |
esac |
1436 |
} |
1437 |
|
1438 |
+ # @FUNCTION: best_version |
1439 |
+ # @USAGE: <DEPEND ATOM> |
1440 |
+ # @DESCRIPTION: |
1441 |
# Returns the best/most-current match. |
1442 |
- # Takes single depend-type atoms. |
1443 |
+ # Callers may override the ROOT variable in order to match packages from an |
1444 |
+ # alternative ROOT. |
1445 |
best_version() { |
1446 |
|
1447 |
+ local eroot |
1448 |
+ case "$EAPI" in |
1449 |
- 0|1|2) |
1450 |
- eroot=${ROOT} |
1451 |
- ;; |
1452 |
++ # PREFIX LOCAL: always support ED |
1453 |
++ #0|1|2) |
1454 |
++ # eroot=${ROOT} |
1455 |
++ # ;; |
1456 |
++ # END PREFIX LOCAL |
1457 |
+ *) |
1458 |
+ eroot=${ROOT%/}${EPREFIX}/ |
1459 |
+ ;; |
1460 |
+ esac |
1461 |
if [[ -n $PORTAGE_IPC_DAEMON ]] ; then |
1462 |
- "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" |
1463 |
+ "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1" |
1464 |
else |
1465 |
PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ |
1466 |
- "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" best_version "${ROOT}" "$1" |
1467 |
- "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1" |
1468 |
++ "${PORTAGE_PYTHON:-@PORTAGE_PREFIX_PYTHON@}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1" |
1469 |
fi |
1470 |
local retval=$? |
1471 |
case "${retval}" in |
1472 |
diff --cc pym/_emerge/main.py |
1473 |
index e9eb025,a2995e2..97a4b48 |
1474 |
--- a/pym/_emerge/main.py |
1475 |
+++ b/pym/_emerge/main.py |
1476 |
@@@ -98,9 -97,24 +98,24 @@@ shortmapping= |
1477 |
"v":"--verbose", "V":"--version" |
1478 |
} |
1479 |
|
1480 |
+ COWSAY_MOO = """ |
1481 |
+ |
1482 |
+ Larry loves Gentoo (%s) |
1483 |
+ |
1484 |
+ _______________________ |
1485 |
+ < Have you mooed today? > |
1486 |
+ ----------------------- |
1487 |
+ \ ^__^ |
1488 |
+ \ (oo)\_______ |
1489 |
+ (__)\ )\/\ |
1490 |
+ ||----w | |
1491 |
+ || || |
1492 |
+ |
1493 |
+ """ |
1494 |
+ |
1495 |
def chk_updated_info_files(root, infodirs, prev_mtimes, retval): |
1496 |
|
1497 |
- if os.path.exists("/usr/bin/install-info"): |
1498 |
+ if os.path.exists(EPREFIX + "/usr/bin/install-info"): |
1499 |
out = portage.output.EOutput() |
1500 |
regen_infodirs=[] |
1501 |
for z in infodirs: |
1502 |
diff --cc pym/portage/dbapi/bintree.py |
1503 |
index 48c075f,31ba364..5f46dad |
1504 |
--- a/pym/portage/dbapi/bintree.py |
1505 |
+++ b/pym/portage/dbapi/bintree.py |
1506 |
@@@ -69,7 -68,7 +69,7 @@@ class bindbapi(fakedbapi) |
1507 |
["BUILD_TIME", "CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS", |
1508 |
"LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", |
1509 |
"RDEPEND", "repository", "RESTRICT", "SLOT", "USE", "DEFINED_PHASES", |
1510 |
- "REQUIRED_USE", "EPREFIX"]) |
1511 |
- ]) |
1512 |
++ "EPREFIX"]) |
1513 |
self._aux_cache_slot_dict = slot_dict_class(self._aux_cache_keys) |
1514 |
self._aux_cache = {} |
1515 |
|
1516 |
@@@ -291,7 -290,7 +291,7 @@@ class binarytree(object) |
1517 |
["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI", |
1518 |
"IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES", |
1519 |
"PROVIDE", "RDEPEND", "repository", "SLOT", "USE", "DEFINED_PHASES", |
1520 |
- "REQUIRED_USE", "BASE_URI", "EPREFIX"] |
1521 |
- "BASE_URI"] |
1522 |
++ "BASE_URI", "EPREFIX"] |
1523 |
self._pkgindex_aux_keys = list(self._pkgindex_aux_keys) |
1524 |
self._pkgindex_use_evaluated_keys = \ |
1525 |
("LICENSE", "RDEPEND", "DEPEND", |
1526 |
@@@ -317,9 -316,8 +317,8 @@@ |
1527 |
"SLOT" : "0", |
1528 |
"USE" : "", |
1529 |
"DEFINED_PHASES" : "", |
1530 |
- "REQUIRED_USE" : "" |
1531 |
} |
1532 |
- self._pkgindex_inherited_keys = ["CHOST", "repository"] |
1533 |
+ self._pkgindex_inherited_keys = ["CHOST", "repository", "EPREFIX"] |
1534 |
|
1535 |
# Populate the header with appropriate defaults. |
1536 |
self._pkgindex_default_header_data = { |