1 |
commit: 1b9bf9900acb9fe2b2f337e4947c6f290a8ccfa4 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 6 13:21:58 2018 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 6 13:22:15 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b9bf990 |
7 |
|
8 |
Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
.travis.yml | 7 + |
13 |
RELEASE-NOTES | 54 +++++ |
14 |
bin/ebuild | 6 + |
15 |
bin/ebuild-helpers/dodoc | 3 +- |
16 |
bin/ebuild-helpers/ecompress | 161 ------------- |
17 |
bin/ebuild-helpers/ecompressdir | 226 ------------------- |
18 |
bin/ebuild-helpers/fowners | 15 ++ |
19 |
bin/ebuild-helpers/fperms | 15 ++ |
20 |
bin/ebuild-helpers/prepall | 29 +-- |
21 |
bin/ebuild-helpers/prepalldocs | 19 +- |
22 |
bin/ebuild-helpers/prepallinfo | 9 +- |
23 |
bin/ebuild-helpers/prepallman | 24 +- |
24 |
bin/ebuild-helpers/prepinfo | 3 +- |
25 |
bin/ebuild-helpers/prepman | 35 +-- |
26 |
bin/ebuild.sh | 8 +- |
27 |
bin/ecompress | 198 ++++++++++++++++ |
28 |
bin/ecompress-file | 61 +++++ |
29 |
bin/estrip | 10 +- |
30 |
bin/etc-update | 12 +- |
31 |
bin/helper-functions.sh | 9 +- |
32 |
bin/install-qa-check.d/60pngfix | 13 +- |
33 |
bin/isolated-functions.sh | 30 ++- |
34 |
bin/misc-functions.sh | 211 +++++++---------- |
35 |
bin/phase-functions.sh | 9 +- |
36 |
bin/phase-helpers.sh | 7 +- |
37 |
bin/pid-ns-init | 30 +++ |
38 |
bin/portageq | 4 + |
39 |
bin/postinst-qa-check.d/50gnome2-utils | 2 +- |
40 |
bin/postinst-qa-check.d/50xdg-utils | 2 +- |
41 |
cnf/make.conf.example.arm64.diff | 37 +++ |
42 |
cnf/make.globals | 4 +- |
43 |
lib/_emerge/actions.py | 7 - |
44 |
lib/_emerge/help.py | 2 +- |
45 |
lib/portage/const.py | 7 +- |
46 |
lib/portage/dbapi/porttree.py | 72 ++++-- |
47 |
lib/portage/dbapi/vartree.py | 12 + |
48 |
.../package/ebuild/_config/LocationsManager.py | 5 +- |
49 |
lib/portage/package/ebuild/config.py | 92 +++++--- |
50 |
lib/portage/package/ebuild/doebuild.py | 22 +- |
51 |
lib/portage/process.py | 96 +++++++- |
52 |
lib/portage/repository/config.py | 148 +++++++++--- |
53 |
.../repository/storage}/__init__.py | 2 +- |
54 |
.../repository/storage/hardlink_quarantine.py | 97 ++++++++ |
55 |
lib/portage/repository/storage/hardlink_rcu.py | 251 +++++++++++++++++++++ |
56 |
lib/portage/repository/storage/inplace.py | 49 ++++ |
57 |
lib/portage/repository/storage/interface.py | 87 +++++++ |
58 |
lib/portage/sync/controller.py | 1 + |
59 |
lib/portage/sync/modules/git/git.py | 10 +- |
60 |
lib/portage/sync/modules/rsync/rsync.py | 85 ++----- |
61 |
lib/portage/sync/syncbase.py | 55 ++++- |
62 |
lib/portage/tests/__init__.py | 36 +-- |
63 |
lib/portage/tests/bin/setup_env.py | 2 +- |
64 |
lib/portage/tests/sync/test_sync_local.py | 60 ++++- |
65 |
.../tests/util/futures/test_compat_coroutine.py | 22 +- |
66 |
lib/portage/util/futures/_asyncio/__init__.py | 14 ++ |
67 |
lib/portage/util/futures/_sync_decorator.py | 54 +++++ |
68 |
lib/portage/util/futures/compat_coroutine.py | 20 +- |
69 |
man/ebuild.1 | 5 + |
70 |
man/ebuild.5 | 6 +- |
71 |
man/emerge.1 | 2 +- |
72 |
man/make.conf.5 | 33 ++- |
73 |
man/portage.5 | 35 +++ |
74 |
repoman/RELEASE-NOTES | 18 ++ |
75 |
repoman/bin/repoman | 2 +- |
76 |
repoman/cnf/linechecks/linechecks.yaml | 3 +- |
77 |
repoman/lib/repoman/actions.py | 55 ++++- |
78 |
repoman/lib/repoman/config.py | 8 +- |
79 |
repoman/lib/repoman/copyrights.py | 18 +- |
80 |
repoman/lib/repoman/main.py | 9 +- |
81 |
repoman/lib/repoman/modules/commit/manifest.py | 11 +- |
82 |
.../modules/linechecks/gentoo_header/header.py | 47 ++-- |
83 |
repoman/lib/repoman/scanner.py | 3 +- |
84 |
repoman/lib/repoman/tests/__init__.py | 34 +-- |
85 |
.../lib/repoman/tests/changelog/test_echangelog.py | 2 +- |
86 |
repoman/lib/repoman/tests/simple/test_simple.py | 14 +- |
87 |
repoman/runtests | 6 +- |
88 |
repoman/setup.py | 2 +- |
89 |
runtests | 6 +- |
90 |
setup.py | 4 +- |
91 |
tox.ini | 2 +- |
92 |
80 files changed, 1892 insertions(+), 994 deletions(-) |
93 |
|
94 |
diff --cc bin/ebuild-helpers/dodoc |
95 |
index 2e2b0459c,e83091045..9fdb6495a |
96 |
--- a/bin/ebuild-helpers/dodoc |
97 |
+++ b/bin/ebuild-helpers/dodoc |
98 |
@@@ -1,5 -1,5 +1,5 @@@ |
99 |
-#!/bin/bash |
100 |
+#!@PORTAGE_BASH@ |
101 |
- # Copyright 1999-2012 Gentoo Foundation |
102 |
+ # Copyright 1999-2018 Gentoo Foundation |
103 |
# Distributed under the terms of the GNU General Public License v2 |
104 |
|
105 |
source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 |
106 |
diff --cc bin/ebuild-helpers/prepall |
107 |
index 95bf24be4,e23a6d410..0251e7948 |
108 |
--- a/bin/ebuild-helpers/prepall |
109 |
+++ b/bin/ebuild-helpers/prepall |
110 |
@@@ -1,5 -1,5 +1,5 @@@ |
111 |
-#!/bin/bash |
112 |
+#!@PORTAGE_BASH@ |
113 |
- # Copyright 1999-2012 Gentoo Foundation |
114 |
+ # Copyright 1999-2018 Gentoo Foundation |
115 |
# Distributed under the terms of the GNU General Public License v2 |
116 |
|
117 |
source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 |
118 |
diff --cc bin/ebuild-helpers/prepallman |
119 |
index a7e1eca83,e23a6d410..0251e7948 |
120 |
--- a/bin/ebuild-helpers/prepallman |
121 |
+++ b/bin/ebuild-helpers/prepallman |
122 |
@@@ -1,5 -1,5 +1,5 @@@ |
123 |
-#!/bin/bash |
124 |
+#!@PORTAGE_BASH@ |
125 |
- # Copyright 1999-2012 Gentoo Foundation |
126 |
+ # Copyright 1999-2018 Gentoo Foundation |
127 |
# Distributed under the terms of the GNU General Public License v2 |
128 |
|
129 |
source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 |
130 |
diff --cc bin/etc-update |
131 |
index d75388bba,0c7a51995..0364fb0de |
132 |
--- a/bin/etc-update |
133 |
+++ b/bin/etc-update |
134 |
@@@ -32,13 -32,13 +32,13 @@@ get_config() |
135 |
"${PORTAGE_CONFIGROOT}"etc/etc-update.conf) |
136 |
} |
137 |
|
138 |
- OS_RELEASE_ID=$(cat "@PORTAGE_EPREFIX@"/etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g') |
139 |
-OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE//[[:space:]]/:}:") |
140 |
++OS_RELEASE_POSSIBLE_IDS=$(source "@PORTAGE_EPREFIX@"/etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE//[[:space:]]/:}:") |
141 |
|
142 |
- case $OS_RELEASE_ID in |
143 |
- suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;; |
144 |
- fedora|rhel) OS_FAMILY='rpm' ;; |
145 |
- arch|archarm|arch32|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';; |
146 |
- *) OS_FAMILY='gentoo' ;; |
147 |
+ case ${OS_RELEASE_POSSIBLE_IDS} in |
148 |
+ *:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';; |
149 |
+ *:fedora:*|*:rhel:*) OS_FAMILY='rpm';; |
150 |
+ *:arch:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';; |
151 |
+ *) OS_FAMILY='gentoo';; |
152 |
esac |
153 |
|
154 |
if [[ $OS_FAMILY == 'gentoo' ]]; then |
155 |
diff --cc bin/misc-functions.sh |
156 |
index 6cb88898e,5de26b44d..0590a2862 |
157 |
--- a/bin/misc-functions.sh |
158 |
+++ b/bin/misc-functions.sh |
159 |
@@@ -1,5 -1,5 +1,5 @@@ |
160 |
-#!/bin/bash |
161 |
+#!@PORTAGE_BASH@ |
162 |
- # Copyright 1999-2018 Gentoo Foundation |
163 |
+ # Copyright 1999-2018 Gentoo Authors |
164 |
# Distributed under the terms of the GNU General Public License v2 |
165 |
# |
166 |
# Miscellaneous shell functions that make use of the ebuild env but don't need |
167 |
@@@ -224,51 -99,43 +105,76 @@@ install_qa_check() |
168 |
) |
169 |
done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z) |
170 |
|
171 |
- export STRIP_MASK |
172 |
- prepall |
173 |
- ___eapi_has_docompress && prepcompress |
174 |
- ecompressdir --dequeue |
175 |
- ecompress --dequeue |
176 |
+ if has chflags $FEATURES ; then |
177 |
+ # Save all the file flags for restoration afterwards. |
178 |
+ mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree" |
179 |
+ # Remove all the file flags so that we can do anything necessary. |
180 |
+ chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}" |
181 |
+ chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null |
182 |
+ fi |
183 |
+ |
184 |
+ [[ -d ${ED%/}/usr/share/info ]] && prepinfo |
185 |
+ |
186 |
+ # If binpkg-docompress is enabled, apply compression before creating |
187 |
+ # the binary package. |
188 |
+ if has binpkg-docompress ${FEATURES}; then |
189 |
+ "${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}" |
190 |
+ "${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}" |
191 |
+ "${PORTAGE_BIN_PATH}"/ecompress --dequeue |
192 |
+ fi |
193 |
+ |
194 |
+ # If binpkg-dostrip is enabled, apply stripping before creating |
195 |
+ # the binary package. |
196 |
+ # Note: disabling it won't help with packages calling prepstrip directly. |
197 |
+ if has binpkg-dostrip ${FEATURES}; then |
198 |
+ export STRIP_MASK |
199 |
+ if ___eapi_has_dostrip; then |
200 |
+ "${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}" |
201 |
+ "${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}" |
202 |
+ "${PORTAGE_BIN_PATH}"/estrip --dequeue |
203 |
+ else |
204 |
+ prepallstrip |
205 |
+ fi |
206 |
+ fi |
207 |
|
208 |
- if ___eapi_has_dostrip; then |
209 |
- "${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}" |
210 |
- "${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}" |
211 |
- "${PORTAGE_BIN_PATH}"/estrip --dequeue |
212 |
+ if has chflags $FEATURES ; then |
213 |
+ # Restore all the file flags that were saved earlier on. |
214 |
+ mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null |
215 |
fi |
216 |
|
217 |
+ # PREFIX LOCAL: |
218 |
+ # anything outside the prefix should be caught by the Prefix QA |
219 |
+ # check, so if there's nothing in ED, we skip searching for QA |
220 |
+ # checks there, the specific QA funcs can hence rely on ED existing |
221 |
+ if [[ -d ${ED} ]] ; then |
222 |
+ case ${CHOST} in |
223 |
+ *-darwin*) |
224 |
+ # Mach-O platforms (NeXT, Darwin, OSX) |
225 |
+ install_qa_check_macho |
226 |
+ ;; |
227 |
+ *-interix*|*-winnt*) |
228 |
+ # PECOFF platforms (Windows/Interix) |
229 |
+ install_qa_check_pecoff |
230 |
+ ;; |
231 |
+ *-aix*) |
232 |
+ # XCOFF platforms (AIX) |
233 |
+ install_qa_check_xcoff |
234 |
+ ;; |
235 |
+ *) |
236 |
+ # because this is the majority: ELF platforms (Linux, |
237 |
+ # Solaris, *BSD, IRIX, etc.) |
238 |
+ install_qa_check_elf |
239 |
+ ;; |
240 |
+ esac |
241 |
+ fi |
242 |
+ |
243 |
+ # this is basically here such that the diff with trunk remains just |
244 |
+ # offsetted and not out of order |
245 |
+ install_qa_check_misc |
246 |
+ # END PREFIX LOCAL |
247 |
+} |
248 |
+ |
249 |
+install_qa_check_elf() { |
250 |
# Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is |
251 |
# too useful not to have (it's required for things like preserve-libs), and |
252 |
# it's tempting for ebuild authors to set RESTRICT=binchecks for packages |
253 |
@@@ -303,389 -168,51 +209,434 @@@ install_qa_check_misc() |
254 |
rm -f "${ED%/}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!" |
255 |
} |
256 |
|
257 |
+install_qa_check_macho() { |
258 |
+ if ! has binchecks ${RESTRICT} ; then |
259 |
+ # on Darwin, dynamic libraries are called .dylibs instead of |
260 |
+ # .sos. In addition the version component is before the |
261 |
+ # extension, not after it. Check for this, and *only* warn |
262 |
+ # about it. Some packages do ship .so files on Darwin and make |
263 |
+ # it work (ugly!). |
264 |
+ rm -f "${T}/mach-o.check" |
265 |
+ find ${ED%/} -name "*.so" -or -name "*.so.*" | \ |
266 |
+ while read i ; do |
267 |
+ [[ $(file $i) == *"Mach-O"* ]] && \ |
268 |
+ echo "${i#${D}}" >> "${T}/mach-o.check" |
269 |
+ done |
270 |
+ if [[ -f ${T}/mach-o.check ]] ; then |
271 |
+ f=$(< "${T}/mach-o.check") |
272 |
+ __vecho -ne '\a\n' |
273 |
+ eqawarn "QA Notice: Found .so dynamic libraries on Darwin:" |
274 |
+ eqawarn " ${f//$'\n'/\n }" |
275 |
+ fi |
276 |
+ rm -f "${T}/mach-o.check" |
277 |
+ |
278 |
+ # The naming for dynamic libraries is different on Darwin; the |
279 |
+ # version component is before the extention, instead of after |
280 |
+ # it, as with .sos. Again, make this a warning only. |
281 |
+ rm -f "${T}/mach-o.check" |
282 |
+ find ${ED%/} -name "*.dylib.*" | \ |
283 |
+ while read i ; do |
284 |
+ echo "${i#${D}}" >> "${T}/mach-o.check" |
285 |
+ done |
286 |
+ if [[ -f "${T}/mach-o.check" ]] ; then |
287 |
+ f=$(< "${T}/mach-o.check") |
288 |
+ __vecho -ne '\a\n' |
289 |
+ eqawarn "QA Notice: Found wrongly named dynamic libraries on Darwin:" |
290 |
+ eqawarn " ${f// /\n }" |
291 |
+ fi |
292 |
+ rm -f "${T}/mach-o.check" |
293 |
+ fi |
294 |
+ |
295 |
+ install_name_is_relative() { |
296 |
+ case $1 in |
297 |
+ "@executable_path/"*) return 0 ;; |
298 |
+ "@loader_path"/*) return 0 ;; |
299 |
+ "@rpath/"*) return 0 ;; |
300 |
+ *) return 1 ;; |
301 |
+ esac |
302 |
+ } |
303 |
+ |
304 |
+ # While we generate the NEEDED files, check that we don't get kernel |
305 |
+ # traps at runtime because of broken install_names on Darwin. |
306 |
+ rm -f "${T}"/.install_name_check_failed |
307 |
+ scanmacho -qyRF '%a;%p;%S;%n' "${D}" | { while IFS= read l ; do |
308 |
+ arch=${l%%;*}; l=${l#*;} |
309 |
+ obj="/${l%%;*}"; l=${l#*;} |
310 |
+ install_name=${l%%;*}; l=${l#*;} |
311 |
+ needed=${l%%;*}; l=${l#*;} |
312 |
+ |
313 |
+ ignore= |
314 |
+ qa_var="QA_IGNORE_INSTALL_NAME_FILES_${ARCH/-/_}" |
315 |
+ eval "[[ -n \${!qa_var} ]] && |
316 |
+ QA_IGNORE_INSTALL_NAME_FILES=(\"\${${qa_var}[@]}\")" |
317 |
+ |
318 |
+ if [[ ${#QA_IGNORE_INSTALL_NAME_FILES[@]} -gt 1 ]] ; then |
319 |
+ for x in "${QA_IGNORE_INSTALL_NAME_FILES[@]}" ; do |
320 |
+ [[ ${obj##*/} == ${x} ]] && \ |
321 |
+ ignore=true |
322 |
+ done |
323 |
+ else |
324 |
+ local shopts=$- |
325 |
+ set -o noglob |
326 |
+ for x in ${QA_IGNORE_INSTALL_NAME_FILES} ; do |
327 |
+ [[ ${obj##*/} == ${x} ]] && \ |
328 |
+ ignore=true |
329 |
+ done |
330 |
+ set +o noglob |
331 |
+ set -${shopts} |
332 |
+ fi |
333 |
+ |
334 |
+ # See if the self-reference install_name points to an existing |
335 |
+ # and to be installed file. This usually is a symlink for the |
336 |
+ # major version. |
337 |
+ if install_name_is_relative ${install_name} ; then |
338 |
+ # try to locate the library in the installed image |
339 |
+ local inpath=${install_name#@*/} |
340 |
+ local libl |
341 |
+ for libl in $(find "${ED}" -name "${inpath##*/}") ; do |
342 |
+ if [[ ${libl} == */${inpath} ]] ; then |
343 |
+ install_name=/${libl#${D}} |
344 |
+ break |
345 |
+ fi |
346 |
+ done |
347 |
+ fi |
348 |
+ if [[ ! -e ${D}${install_name} ]] ; then |
349 |
+ eqawarn "QA Notice: invalid self-reference install_name ${install_name} in ${obj}" |
350 |
+ # remember we are in an implicit subshell, that's |
351 |
+ # why we touch a file here ... ideally we should be |
352 |
+ # able to die correctly/nicely here |
353 |
+ [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed |
354 |
+ fi |
355 |
+ |
356 |
+ # this is ugly, paths with spaces won't work |
357 |
+ for lib in ${needed//,/ } ; do |
358 |
+ if [[ ${lib} == ${D}* ]] ; then |
359 |
+ eqawarn "QA Notice: install_name references \${D}: ${lib} in ${obj}" |
360 |
+ [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed |
361 |
+ elif [[ ${lib} == ${S}* ]] ; then |
362 |
+ eqawarn "QA Notice: install_name references \${S}: ${lib} in ${obj}" |
363 |
+ [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed |
364 |
+ elif ! install_name_is_relative ${lib} && [[ ! -e ${lib} && ! -e ${D}${lib} ]] ; then |
365 |
+ eqawarn "QA Notice: invalid reference to ${lib} in ${obj}" |
366 |
+ [[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed |
367 |
+ fi |
368 |
+ done |
369 |
+ |
370 |
+ # backwards compatibility |
371 |
+ echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
372 |
+ # what we use |
373 |
+ echo "${arch};${obj};${install_name};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.MACHO.3 |
374 |
+ done } |
375 |
+ if [[ -f ${T}/.install_name_check_failed ]] ; then |
376 |
+ # secret switch "allow_broken_install_names" to get |
377 |
+ # around this and install broken crap (not a good idea) |
378 |
+ has allow_broken_install_names ${FEATURES} || \ |
379 |
+ die "invalid install_name found, your application or library will crash at runtime" |
380 |
+ fi |
381 |
+} |
382 |
+ |
383 |
+install_qa_check_pecoff() { |
384 |
+ local _pfx_scan="readpecoff ${CHOST}" |
385 |
+ |
386 |
+ # this one uses readpecoff, which supports multiple prefix platforms! |
387 |
+ # this is absolutely _not_ optimized for speed, and there may be plenty |
388 |
+ # of possibilities by introducing one or the other cache! |
389 |
+ if ! has binchecks ${RESTRICT}; then |
390 |
+ # copied and adapted from the above scanelf code. |
391 |
+ local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET} |
392 |
+ local f x |
393 |
+ |
394 |
+ # display warnings when using stricter because we die afterwards |
395 |
+ if has stricter ${FEATURES} ; then |
396 |
+ unset PORTAGE_QUIET |
397 |
+ fi |
398 |
+ |
399 |
+ local _exec_find_opt="-executable" |
400 |
+ [[ ${CHOST} == *-winnt* ]] && _exec_find_opt='-name *.dll -o -name *.exe' |
401 |
+ |
402 |
+ # Make sure we disallow insecure RUNPATH/RPATH's |
403 |
+ # Don't want paths that point to the tree where the package was built |
404 |
+ # (older, broken libtools would do this). Also check for null paths |
405 |
+ # because the loader will search $PWD when it finds null paths. |
406 |
+ |
407 |
+ f=$( |
408 |
+ find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | \ |
409 |
+ while IFS=";" read arch obj soname rpath needed ; do \ |
410 |
+ echo "${rpath}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )" > /dev/null 2>&1 \ |
411 |
+ && echo "${obj}"; done; |
412 |
+ ) |
413 |
+ # Reject set*id binaries with $ORIGIN in RPATH #260331 |
414 |
+ x=$( |
415 |
+ find "${ED}" -type f '(' -perm -u+s -o -perm -g+s ')' -print0 | \ |
416 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; do \ |
417 |
+ echo "${rpath}" | grep '$ORIGIN' > /dev/null 2>&1 && echo "${obj}"; done; |
418 |
+ ) |
419 |
+ if [[ -n ${f}${x} ]] ; then |
420 |
+ __vecho -ne '\a\n' |
421 |
+ eqawarn "QA Notice: The following files contain insecure RUNPATH's" |
422 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
423 |
+ eqawarn " with the maintaining herd of the package." |
424 |
+ eqawarn "${f}${f:+${x:+\n}}${x}" |
425 |
+ __vecho -ne '\a\n' |
426 |
+ if [[ -n ${x} ]] || has stricter ${FEATURES} ; then |
427 |
+ insecure_rpath=1 |
428 |
+ else |
429 |
+ eqawarn "cannot automatically fix runpaths on interix platforms!" |
430 |
+ fi |
431 |
+ fi |
432 |
+ |
433 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
434 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
435 |
+ |
436 |
+ # Save NEEDED information after removing self-contained providers |
437 |
+ find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | { while IFS=';' read arch obj soname rpath needed; do |
438 |
+ # need to strip image dir from object name. |
439 |
+ obj="/${obj#${D}}" |
440 |
+ if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then |
441 |
+ # object doesn't contain $ORIGIN in its runpath attribute |
442 |
+ echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
443 |
+ echo "${arch};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
444 |
+ else |
445 |
+ dir=${obj%/*} |
446 |
+ # replace $ORIGIN with the dirname of the current object for the lookup |
447 |
+ opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#") |
448 |
+ sneeded=$(echo ${needed} | tr , ' ') |
449 |
+ rneeded="" |
450 |
+ for lib in ${sneeded}; do |
451 |
+ found=0 |
452 |
+ for path in ${opath//:/ }; do |
453 |
+ [ -e "${ED}/${path}/${lib}" ] && found=1 && break |
454 |
+ done |
455 |
+ [ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}" |
456 |
+ done |
457 |
+ rneeded=${rneeded:1} |
458 |
+ if [ -n "${rneeded}" ]; then |
459 |
+ echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED |
460 |
+ echo "${arch};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1 |
461 |
+ fi |
462 |
+ fi |
463 |
+ done } |
464 |
+ |
465 |
+ if [[ ${insecure_rpath} -eq 1 ]] ; then |
466 |
+ die "Aborting due to serious QA concerns with RUNPATH/RPATH" |
467 |
+ elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then |
468 |
+ die "Aborting due to QA concerns: ${die_msg}" |
469 |
+ fi |
470 |
+ |
471 |
+ local _so_ext='.so*' |
472 |
+ |
473 |
+ case "${CHOST}" in |
474 |
+ *-winnt*) _so_ext=".dll" ;; # no "*" intentionally! |
475 |
+ esac |
476 |
+ |
477 |
+ # Run some sanity checks on shared libraries |
478 |
+ for d in "${ED}"lib* "${ED}"usr/lib* ; do |
479 |
+ [[ -d "${d}" ]] || continue |
480 |
+ f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \ |
481 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \ |
482 |
+ do [[ -z "${soname}" ]] && echo "${obj}"; done) |
483 |
+ if [[ -n ${f} ]] ; then |
484 |
+ __vecho -ne '\a\n' |
485 |
+ eqawarn "QA Notice: The following shared libraries lack a SONAME" |
486 |
+ eqawarn "${f}" |
487 |
+ __vecho -ne '\a\n' |
488 |
+ sleep 1 |
489 |
+ fi |
490 |
+ |
491 |
+ f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \ |
492 |
+ xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \ |
493 |
+ do [[ -z "${needed}" ]] && echo "${obj}"; done) |
494 |
+ if [[ -n ${f} ]] ; then |
495 |
+ __vecho -ne '\a\n' |
496 |
+ eqawarn "QA Notice: The following shared libraries lack NEEDED entries" |
497 |
+ eqawarn "${f}" |
498 |
+ __vecho -ne '\a\n' |
499 |
+ sleep 1 |
500 |
+ fi |
501 |
+ done |
502 |
+ |
503 |
+ PORTAGE_QUIET=${tmp_quiet} |
504 |
+ fi |
505 |
+} |
506 |
+ |
507 |
+install_qa_check_xcoff() { |
508 |
+ if ! has binchecks ${RESTRICT}; then |
509 |
+ local tmp_quiet=${PORTAGE_QUIET} |
510 |
+ local queryline deplib |
511 |
+ local insecure_rpath_list= undefined_symbols_list= |
512 |
+ |
513 |
+ # display warnings when using stricter because we die afterwards |
514 |
+ if has stricter ${FEATURES} ; then |
515 |
+ unset PORTAGE_QUIET |
516 |
+ fi |
517 |
+ |
518 |
+ rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1 |
519 |
+ |
520 |
+ local neededfd |
521 |
+ for neededfd in {3..1024} none; do ( : <&${neededfd} ) 2>/dev/null || break; done |
522 |
+ [[ ${neededfd} != none ]] || die "cannot find free file descriptor handle" |
523 |
+ |
524 |
+ eval "exec ${neededfd}>\"${PORTAGE_BUILDDIR}\"/build-info/NEEDED.XCOFF.1" || die "cannot open ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1" |
525 |
+ |
526 |
+ ( # work around a problem in /usr/bin/dump (used by aixdll-query) |
527 |
+ # dumping core when path names get too long. |
528 |
+ cd "${ED}" >/dev/null && |
529 |
+ find . -not -type d -exec \ |
530 |
+ aixdll-query '{}' FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS ';' |
531 |
+ ) > "${T}"/needed 2>/dev/null |
532 |
+ |
533 |
+ # Symlinking shared archive libraries is not a good idea on aix, |
534 |
+ # as there is nothing like "soname" on pure filesystem level. |
535 |
+ # So we create a copy instead of the symlink. |
536 |
+ local prev_FILE= |
537 |
+ local FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS |
538 |
+ while read queryline |
539 |
+ do |
540 |
+ FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS= |
541 |
+ eval ${queryline} |
542 |
+ FILE=${FILE#./} |
543 |
+ |
544 |
+ if [[ ${prev_FILE} != ${FILE} ]]; then |
545 |
+ if [[ " ${FLAGS} " == *" SHROBJ "* && -h ${ED}${FILE} ]]; then |
546 |
+ prev_FILE=${FILE} |
547 |
+ local target=$(readlink "${ED}${FILE}") |
548 |
+ if [[ ${target} == /* ]]; then |
549 |
+ target=${D}${target} |
550 |
+ else |
551 |
+ target=${FILE%/*}/${target} |
552 |
+ fi |
553 |
+ rm -f "${ED}${FILE}" || die "cannot prune ${FILE}" |
554 |
+ cp -f "${ED}${target}" "${ED}${FILE}" || die "cannot copy ${target} to ${FILE}" |
555 |
+ fi |
556 |
+ fi |
557 |
+ done <"${T}"/needed |
558 |
+ |
559 |
+ prev_FILE= |
560 |
+ while read queryline |
561 |
+ do |
562 |
+ FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS= |
563 |
+ eval ${queryline} |
564 |
+ FILE=${FILE#./} |
565 |
+ |
566 |
+ if [[ -n ${MEMBER} && ${prev_FILE} != ${FILE} ]]; then |
567 |
+ # Save NEEDED information for each archive library stub |
568 |
+ # even if it is static only: the already installed archive |
569 |
+ # may contain shared objects to be preserved. |
570 |
+ echo "${FORMAT##* }${FORMAT%%-*};${EPREFIX}/${FILE};${FILE##*/};;" >&${neededfd} |
571 |
+ fi |
572 |
+ prev_FILE=${FILE} |
573 |
+ |
574 |
+ # shared objects have both EXEC and SHROBJ flags, |
575 |
+ # while executables have EXEC flag only. |
576 |
+ [[ " ${FLAGS} " == *" EXEC "* ]] || continue |
577 |
+ |
578 |
+ # Make sure we disallow insecure RUNPATH's |
579 |
+ # Don't want paths that point to the tree where the package was built |
580 |
+ # (older, broken libtools would do this). Also check for null paths |
581 |
+ # because the loader will search $PWD when it finds null paths. |
582 |
+ # And we really want absolute paths only. |
583 |
+ if [[ -n $(echo ":${RUNPATH}:" | grep -E "(${PORTAGE_BUILDDIR}|::|:[^/])") ]]; then |
584 |
+ insecure_rpath_list="${insecure_rpath_list}\n${FILE}${MEMBER:+[${MEMBER}]}" |
585 |
+ fi |
586 |
+ |
587 |
+ local needed= |
588 |
+ [[ -n ${MEMBER} ]] && needed=${FILE##*/} |
589 |
+ for deplib in ${DEPLIBS}; do |
590 |
+ eval deplib=${deplib} |
591 |
+ if [[ ${deplib} == '.' || ${deplib} == '..' ]]; then |
592 |
+ # Although we do have runtime linking, we don't want undefined symbols. |
593 |
+ # AIX does indicate this by needing either '.' or '..' |
594 |
+ undefined_symbols_list="${undefined_symbols_list}\n${FILE}" |
595 |
+ else |
596 |
+ needed="${needed}${needed:+,}${deplib}" |
597 |
+ fi |
598 |
+ done |
599 |
+ |
600 |
+ FILE=${EPREFIX}/${FILE} |
601 |
+ |
602 |
+ [[ -n ${MEMBER} ]] && MEMBER="[${MEMBER}]" |
603 |
+ # Save NEEDED information |
604 |
+ echo "${FORMAT##* }${FORMAT%%-*};${FILE}${MEMBER};${FILE##*/}${MEMBER};${RUNPATH};${needed}" >&${neededfd} |
605 |
+ done <"${T}"/needed |
606 |
+ |
607 |
+ eval "exec ${neededfd}>&-" || die "cannot close handle to ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1" |
608 |
+ |
609 |
+ if [[ -n ${undefined_symbols_list} ]]; then |
610 |
+ __vecho -ne '\a\n' |
611 |
+ eqawarn "QA Notice: The following files contain undefined symbols." |
612 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
613 |
+ eqawarn " with 'prefix' as the maintaining herd of the package." |
614 |
+ eqawarn "${undefined_symbols_list}" |
615 |
+ __vecho -ne '\a\n' |
616 |
+ fi |
617 |
+ |
618 |
+ if [[ -n ${insecure_rpath_list} ]] ; then |
619 |
+ __vecho -ne '\a\n' |
620 |
+ eqawarn "QA Notice: The following files contain insecure RUNPATH's" |
621 |
+ eqawarn " Please file a bug about this at http://bugs.gentoo.org/" |
622 |
+ eqawarn " with 'prefix' as the maintaining herd of the package." |
623 |
+ eqawarn "${insecure_rpath_list}" |
624 |
+ __vecho -ne '\a\n' |
625 |
+ if has stricter ${FEATURES} ; then |
626 |
+ insecure_rpath=1 |
627 |
+ fi |
628 |
+ fi |
629 |
+ |
630 |
+ if [[ ${insecure_rpath} -eq 1 ]] ; then |
631 |
+ die "Aborting due to serious QA concerns with RUNPATH/RPATH" |
632 |
+ elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then |
633 |
+ die "Aborting due to QA concerns: ${die_msg}" |
634 |
+ fi |
635 |
+ |
636 |
+ PORTAGE_QUIET=${tmp_quiet} |
637 |
+ fi |
638 |
+} |
639 |
+ |
640 |
+ __dyn_instprep() { |
641 |
+ if [[ -e ${PORTAGE_BUILDDIR}/.instprepped ]] ; then |
642 |
+ __vecho ">>> It appears that '$PF' is already instprepped; skipping." |
643 |
+ __vecho ">>> Remove '${PORTAGE_BUILDDIR}/.instprepped' to force instprep." |
644 |
+ return 0 |
645 |
+ fi |
646 |
+ |
647 |
+ if has chflags ${FEATURES}; then |
648 |
+ # Save all the file flags for restoration afterwards. |
649 |
+ mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree" |
650 |
+ # Remove all the file flags so that we can do anything necessary. |
651 |
+ chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}" |
652 |
+ chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null |
653 |
+ fi |
654 |
+ |
655 |
+ # If binpkg-docompress is disabled, we need to apply compression |
656 |
+ # before installing. |
657 |
+ if ! has binpkg-docompress ${FEATURES}; then |
658 |
+ "${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}" |
659 |
+ "${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}" |
660 |
+ "${PORTAGE_BIN_PATH}"/ecompress --dequeue |
661 |
+ fi |
662 |
+ |
663 |
+ # If binpkg-dostrip is disabled, apply stripping before creating |
664 |
+ # the binary package. |
665 |
+ if ! has binpkg-dostrip ${FEATURES}; then |
666 |
+ export STRIP_MASK |
667 |
+ if ___eapi_has_dostrip; then |
668 |
+ "${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}" |
669 |
+ "${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}" |
670 |
+ "${PORTAGE_BIN_PATH}"/estrip --dequeue |
671 |
+ else |
672 |
+ prepallstrip |
673 |
+ fi |
674 |
+ fi |
675 |
+ |
676 |
+ if has chflags ${FEATURES}; then |
677 |
+ # Restore all the file flags that were saved earlier on. |
678 |
+ mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null |
679 |
+ fi |
680 |
+ |
681 |
+ >> "${PORTAGE_BUILDDIR}/.instprepped" || \ |
682 |
+ die "Failed to create ${PORTAGE_BUILDDIR}/.instprepped" |
683 |
+ } |
684 |
+ |
685 |
preinst_qa_check() { |
686 |
postinst_qa_check preinst |
687 |
} |