public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:prefix commit in: /
Date: Wed, 12 Dec 2018 18:54:26 +0000 (UTC)	[thread overview]
Message-ID: <1544102535.1b9bf9900acb9fe2b2f337e4947c6f290a8ccfa4.grobian@gentoo> (raw)

commit:     1b9bf9900acb9fe2b2f337e4947c6f290a8ccfa4
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  6 13:21:58 2018 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec  6 13:22:15 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1b9bf990

Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .travis.yml                                        |   7 +
 RELEASE-NOTES                                      |  54 +++++
 bin/ebuild                                         |   6 +
 bin/ebuild-helpers/dodoc                           |   3 +-
 bin/ebuild-helpers/ecompress                       | 161 -------------
 bin/ebuild-helpers/ecompressdir                    | 226 -------------------
 bin/ebuild-helpers/fowners                         |  15 ++
 bin/ebuild-helpers/fperms                          |  15 ++
 bin/ebuild-helpers/prepall                         |  29 +--
 bin/ebuild-helpers/prepalldocs                     |  19 +-
 bin/ebuild-helpers/prepallinfo                     |   9 +-
 bin/ebuild-helpers/prepallman                      |  24 +-
 bin/ebuild-helpers/prepinfo                        |   3 +-
 bin/ebuild-helpers/prepman                         |  35 +--
 bin/ebuild.sh                                      |   8 +-
 bin/ecompress                                      | 198 ++++++++++++++++
 bin/ecompress-file                                 |  61 +++++
 bin/estrip                                         |  10 +-
 bin/etc-update                                     |  12 +-
 bin/helper-functions.sh                            |   9 +-
 bin/install-qa-check.d/60pngfix                    |  13 +-
 bin/isolated-functions.sh                          |  30 ++-
 bin/misc-functions.sh                              | 211 +++++++----------
 bin/phase-functions.sh                             |   9 +-
 bin/phase-helpers.sh                               |   7 +-
 bin/pid-ns-init                                    |  30 +++
 bin/portageq                                       |   4 +
 bin/postinst-qa-check.d/50gnome2-utils             |   2 +-
 bin/postinst-qa-check.d/50xdg-utils                |   2 +-
 cnf/make.conf.example.arm64.diff                   |  37 +++
 cnf/make.globals                                   |   4 +-
 lib/_emerge/actions.py                             |   7 -
 lib/_emerge/help.py                                |   2 +-
 lib/portage/const.py                               |   7 +-
 lib/portage/dbapi/porttree.py                      |  72 ++++--
 lib/portage/dbapi/vartree.py                       |  12 +
 .../package/ebuild/_config/LocationsManager.py     |   5 +-
 lib/portage/package/ebuild/config.py               |  92 +++++---
 lib/portage/package/ebuild/doebuild.py             |  22 +-
 lib/portage/process.py                             |  96 +++++++-
 lib/portage/repository/config.py                   | 148 +++++++++---
 .../repository/storage}/__init__.py                |   2 +-
 .../repository/storage/hardlink_quarantine.py      |  97 ++++++++
 lib/portage/repository/storage/hardlink_rcu.py     | 251 +++++++++++++++++++++
 lib/portage/repository/storage/inplace.py          |  49 ++++
 lib/portage/repository/storage/interface.py        |  87 +++++++
 lib/portage/sync/controller.py                     |   1 +
 lib/portage/sync/modules/git/git.py                |  10 +-
 lib/portage/sync/modules/rsync/rsync.py            |  85 ++-----
 lib/portage/sync/syncbase.py                       |  55 ++++-
 lib/portage/tests/__init__.py                      |  36 +--
 lib/portage/tests/bin/setup_env.py                 |   2 +-
 lib/portage/tests/sync/test_sync_local.py          |  60 ++++-
 .../tests/util/futures/test_compat_coroutine.py    |  22 +-
 lib/portage/util/futures/_asyncio/__init__.py      |  14 ++
 lib/portage/util/futures/_sync_decorator.py        |  54 +++++
 lib/portage/util/futures/compat_coroutine.py       |  20 +-
 man/ebuild.1                                       |   5 +
 man/ebuild.5                                       |   6 +-
 man/emerge.1                                       |   2 +-
 man/make.conf.5                                    |  33 ++-
 man/portage.5                                      |  35 +++
 repoman/RELEASE-NOTES                              |  18 ++
 repoman/bin/repoman                                |   2 +-
 repoman/cnf/linechecks/linechecks.yaml             |   3 +-
 repoman/lib/repoman/actions.py                     |  55 ++++-
 repoman/lib/repoman/config.py                      |   8 +-
 repoman/lib/repoman/copyrights.py                  |  18 +-
 repoman/lib/repoman/main.py                        |   9 +-
 repoman/lib/repoman/modules/commit/manifest.py     |  11 +-
 .../modules/linechecks/gentoo_header/header.py     |  47 ++--
 repoman/lib/repoman/scanner.py                     |   3 +-
 repoman/lib/repoman/tests/__init__.py              |  34 +--
 .../lib/repoman/tests/changelog/test_echangelog.py |   2 +-
 repoman/lib/repoman/tests/simple/test_simple.py    |  14 +-
 repoman/runtests                                   |   6 +-
 repoman/setup.py                                   |   2 +-
 runtests                                           |   6 +-
 setup.py                                           |   4 +-
 tox.ini                                            |   2 +-
 80 files changed, 1892 insertions(+), 994 deletions(-)

diff --cc bin/ebuild-helpers/dodoc
index 2e2b0459c,e83091045..9fdb6495a
--- a/bin/ebuild-helpers/dodoc
+++ b/bin/ebuild-helpers/dodoc
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2012 Gentoo Foundation
+ # Copyright 1999-2018 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
diff --cc bin/ebuild-helpers/prepall
index 95bf24be4,e23a6d410..0251e7948
--- a/bin/ebuild-helpers/prepall
+++ b/bin/ebuild-helpers/prepall
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2012 Gentoo Foundation
+ # Copyright 1999-2018 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
diff --cc bin/ebuild-helpers/prepallman
index a7e1eca83,e23a6d410..0251e7948
--- a/bin/ebuild-helpers/prepallman
+++ b/bin/ebuild-helpers/prepallman
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2012 Gentoo Foundation
+ # Copyright 1999-2018 Gentoo Foundation
  # Distributed under the terms of the GNU General Public License v2
  
  source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
diff --cc bin/etc-update
index d75388bba,0c7a51995..0364fb0de
--- a/bin/etc-update
+++ b/bin/etc-update
@@@ -32,13 -32,13 +32,13 @@@ get_config() 
  		"${PORTAGE_CONFIGROOT}"etc/etc-update.conf)
  }
  
- OS_RELEASE_ID=$(cat "@PORTAGE_EPREFIX@"/etc/os-release 2>/dev/null | grep '^ID=' | cut -d'=' -f2 | sed -e 's/"//g')
 -OS_RELEASE_POSSIBLE_IDS=$(source /etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE//[[:space:]]/:}:")
++OS_RELEASE_POSSIBLE_IDS=$(source "@PORTAGE_EPREFIX@"/etc/os-release >/dev/null 2>&1; echo ":${ID}:${ID_LIKE//[[:space:]]/:}:")
  
- case $OS_RELEASE_ID in
- 	suse|opensuse|opensuse-leap|opensuse-tumbleweed) OS_FAMILY='rpm' ;;
- 	fedora|rhel) OS_FAMILY='rpm' ;;
- 	arch|archarm|arch32|manjaro|antergos) OS_FAMILY='arch' NEW_EXT='pacnew';;
- 	*) OS_FAMILY='gentoo' ;;
+ case ${OS_RELEASE_POSSIBLE_IDS} in
+ 	*:suse:*|*:opensuse:*|*:opensuse-tumbleweed:*) OS_FAMILY='rpm';;
+ 	*:fedora:*|*:rhel:*) OS_FAMILY='rpm';;
+ 	*:arch:*|*:antergos:*) OS_FAMILY='arch' NEW_EXT='pacnew';;
+ 	*) OS_FAMILY='gentoo';;
  esac
  
  if [[ $OS_FAMILY == 'gentoo' ]]; then
diff --cc bin/misc-functions.sh
index 6cb88898e,5de26b44d..0590a2862
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@@ -1,5 -1,5 +1,5 @@@
 -#!/bin/bash
 +#!@PORTAGE_BASH@
- # Copyright 1999-2018 Gentoo Foundation
+ # Copyright 1999-2018 Gentoo Authors
  # Distributed under the terms of the GNU General Public License v2
  #
  # Miscellaneous shell functions that make use of the ebuild env but don't need
@@@ -224,51 -99,43 +105,76 @@@ install_qa_check() 
  		)
  	done < <(printf "%s\0" "${qa_checks[@]}" | LC_ALL=C sort -u -z)
  
- 	export STRIP_MASK
- 	prepall
- 	___eapi_has_docompress && prepcompress
- 	ecompressdir --dequeue
- 	ecompress --dequeue
+ 	if has chflags $FEATURES ; then
+ 		# Save all the file flags for restoration afterwards.
+ 		mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
+ 		# Remove all the file flags so that we can do anything necessary.
+ 		chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+ 		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
+ 	fi
+ 
+ 	[[ -d ${ED%/}/usr/share/info ]] && prepinfo
+ 
+ 	# If binpkg-docompress is enabled, apply compression before creating
+ 	# the binary package.
+ 	if has binpkg-docompress ${FEATURES}; then
+ 		"${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
+ 		"${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
+ 		"${PORTAGE_BIN_PATH}"/ecompress --dequeue
+ 	fi
+ 
+ 	# If binpkg-dostrip is enabled, apply stripping before creating
+ 	# the binary package.
+ 	# Note: disabling it won't help with packages calling prepstrip directly.
+ 	if has binpkg-dostrip ${FEATURES}; then
+ 		export STRIP_MASK
+ 		if ___eapi_has_dostrip; then
+ 			"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
+ 			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
+ 			"${PORTAGE_BIN_PATH}"/estrip --dequeue
+ 		else
+ 			prepallstrip
+ 		fi
+ 	fi
  
- 	if ___eapi_has_dostrip; then
- 		"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
- 		"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
- 		"${PORTAGE_BIN_PATH}"/estrip --dequeue
+ 	if has chflags $FEATURES ; then
+ 		# Restore all the file flags that were saved earlier on.
+ 		mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
  	fi
  
 +	# PREFIX LOCAL:
 +	# anything outside the prefix should be caught by the Prefix QA
 +	# check, so if there's nothing in ED, we skip searching for QA
 +	# checks there, the specific QA funcs can hence rely on ED existing
 +	if [[ -d ${ED} ]] ; then
 +		case ${CHOST} in
 +			*-darwin*)
 +				# Mach-O platforms (NeXT, Darwin, OSX)
 +				install_qa_check_macho
 +			;;
 +			*-interix*|*-winnt*)
 +				# PECOFF platforms (Windows/Interix)
 +				install_qa_check_pecoff
 +			;;
 +			*-aix*)
 +				# XCOFF platforms (AIX)
 +				install_qa_check_xcoff
 +			;;
 +			*)
 +				# because this is the majority: ELF platforms (Linux,
 +				# Solaris, *BSD, IRIX, etc.)
 +				install_qa_check_elf
 +			;;
 +		esac
 +	fi
 +
 +	# this is basically here such that the diff with trunk remains just
 +	# offsetted and not out of order
 +	install_qa_check_misc
 +	# END PREFIX LOCAL
 +}
 +
 +install_qa_check_elf() {
  	# Create NEEDED.ELF.2 regardless of RESTRICT=binchecks, since this info is
  	# too useful not to have (it's required for things like preserve-libs), and
  	# it's tempting for ebuild authors to set RESTRICT=binchecks for packages
@@@ -303,389 -168,51 +209,434 @@@ install_qa_check_misc() 
  	rm -f "${ED%/}"/usr/share/info/dir{,.gz,.bz2} || die "rm failed!"
  }
  
 +install_qa_check_macho() {
 +	if ! has binchecks ${RESTRICT} ; then
 +		# on Darwin, dynamic libraries are called .dylibs instead of
 +		# .sos.  In addition the version component is before the
 +		# extension, not after it.  Check for this, and *only* warn
 +		# about it.  Some packages do ship .so files on Darwin and make
 +		# it work (ugly!).
 +		rm -f "${T}/mach-o.check"
 +		find ${ED%/} -name "*.so" -or -name "*.so.*" | \
 +		while read i ; do
 +			[[ $(file $i) == *"Mach-O"* ]] && \
 +				echo "${i#${D}}" >> "${T}/mach-o.check"
 +		done
 +		if [[ -f ${T}/mach-o.check ]] ; then
 +			f=$(< "${T}/mach-o.check")
 +			__vecho -ne '\a\n'
 +			eqawarn "QA Notice: Found .so dynamic libraries on Darwin:"
 +			eqawarn "    ${f//$'\n'/\n    }"
 +		fi
 +		rm -f "${T}/mach-o.check"
 +
 +		# The naming for dynamic libraries is different on Darwin; the
 +		# version component is before the extention, instead of after
 +		# it, as with .sos.  Again, make this a warning only.
 +		rm -f "${T}/mach-o.check"
 +		find ${ED%/} -name "*.dylib.*" | \
 +		while read i ; do
 +			echo "${i#${D}}" >> "${T}/mach-o.check"
 +		done
 +		if [[ -f "${T}/mach-o.check" ]] ; then
 +			f=$(< "${T}/mach-o.check")
 +			__vecho -ne '\a\n'
 +			eqawarn "QA Notice: Found wrongly named dynamic libraries on Darwin:"
 +			eqawarn "    ${f// /\n    }"
 +		fi
 +		rm -f "${T}/mach-o.check"
 +	fi
 +
 +	install_name_is_relative() {
 +		case $1 in
 +			"@executable_path/"*)  return 0  ;;
 +			"@loader_path"/*)      return 0  ;;
 +			"@rpath/"*)            return 0  ;;
 +			*)                     return 1  ;;
 +		esac
 +	}
 +
 +	# While we generate the NEEDED files, check that we don't get kernel
 +	# traps at runtime because of broken install_names on Darwin.
 +	rm -f "${T}"/.install_name_check_failed
 +	scanmacho -qyRF '%a;%p;%S;%n' "${D}" | { while IFS= read l ; do
 +		arch=${l%%;*}; l=${l#*;}
 +		obj="/${l%%;*}"; l=${l#*;}
 +		install_name=${l%%;*}; l=${l#*;}
 +		needed=${l%%;*}; l=${l#*;}
 +
 +		ignore=
 +		qa_var="QA_IGNORE_INSTALL_NAME_FILES_${ARCH/-/_}"
 +		eval "[[ -n \${!qa_var} ]] &&
 +			QA_IGNORE_INSTALL_NAME_FILES=(\"\${${qa_var}[@]}\")"
 +
 +		if [[ ${#QA_IGNORE_INSTALL_NAME_FILES[@]} -gt 1 ]] ; then
 +			for x in "${QA_IGNORE_INSTALL_NAME_FILES[@]}" ; do
 +				[[ ${obj##*/} == ${x} ]] && \
 +					ignore=true
 +			done
 +		else
 +			local shopts=$-
 +			set -o noglob
 +			for x in ${QA_IGNORE_INSTALL_NAME_FILES} ; do
 +				[[ ${obj##*/} == ${x} ]] && \
 +					ignore=true
 +			done
 +			set +o noglob
 +			set -${shopts}
 +		fi
 +
 +		# See if the self-reference install_name points to an existing
 +		# and to be installed file.  This usually is a symlink for the
 +		# major version.
 +		if install_name_is_relative ${install_name} ; then
 +			# try to locate the library in the installed image
 +			local inpath=${install_name#@*/}
 +			local libl
 +			for libl in $(find "${ED}" -name "${inpath##*/}") ; do
 +				if [[ ${libl} == */${inpath} ]] ; then
 +					install_name=/${libl#${D}}
 +					break
 +				fi
 +			done
 +		fi
 +		if [[ ! -e ${D}${install_name} ]] ; then
 +			eqawarn "QA Notice: invalid self-reference install_name ${install_name} in ${obj}"
 +			# remember we are in an implicit subshell, that's
 +			# why we touch a file here ... ideally we should be
 +			# able to die correctly/nicely here
 +			[[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed
 +		fi
 +
 +		# this is ugly, paths with spaces won't work
 +		for lib in ${needed//,/ } ; do
 +			if [[ ${lib} == ${D}* ]] ; then
 +				eqawarn "QA Notice: install_name references \${D}: ${lib} in ${obj}"
 +				[[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed
 +			elif [[ ${lib} == ${S}* ]] ; then
 +				eqawarn "QA Notice: install_name references \${S}: ${lib} in ${obj}"
 +				[[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed
 +			elif ! install_name_is_relative ${lib} && [[ ! -e ${lib} && ! -e ${D}${lib} ]] ; then
 +				eqawarn "QA Notice: invalid reference to ${lib} in ${obj}"
 +				[[ -z ${ignore} ]] && touch "${T}"/.install_name_check_failed
 +			fi
 +		done
 +
 +		# backwards compatibility
 +		echo "${obj} ${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 +		# what we use
 +		echo "${arch};${obj};${install_name};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.MACHO.3
 +	done }
 +	if [[ -f ${T}/.install_name_check_failed ]] ; then
 +		# secret switch "allow_broken_install_names" to get
 +		# around this and install broken crap (not a good idea)
 +		has allow_broken_install_names ${FEATURES} || \
 +			die "invalid install_name found, your application or library will crash at runtime"
 +	fi
 +}
 +
 +install_qa_check_pecoff() {
 +	local _pfx_scan="readpecoff ${CHOST}"
 +
 +	# this one uses readpecoff, which supports multiple prefix platforms!
 +	# this is absolutely _not_ optimized for speed, and there may be plenty
 +	# of possibilities by introducing one or the other cache!
 +	if ! has binchecks ${RESTRICT}; then
 +		# copied and adapted from the above scanelf code.
 +		local qa_var insecure_rpath=0 tmp_quiet=${PORTAGE_QUIET}
 +		local f x
 +
 +		# display warnings when using stricter because we die afterwards
 +		if has stricter ${FEATURES} ; then
 +			unset PORTAGE_QUIET
 +		fi
 +
 +		local _exec_find_opt="-executable"
 +		[[ ${CHOST} == *-winnt* ]] && _exec_find_opt='-name *.dll -o -name *.exe'
 +
 +		# Make sure we disallow insecure RUNPATH/RPATH's
 +		# Don't want paths that point to the tree where the package was built
 +		# (older, broken libtools would do this).  Also check for null paths
 +		# because the loader will search $PWD when it finds null paths.
 +
 +		f=$(
 +			find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | \
 +			while IFS=";" read arch obj soname rpath needed ; do \
 +			echo "${rpath}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )" > /dev/null 2>&1 \
 +				&& echo "${obj}"; done;
 +		)
 +		# Reject set*id binaries with $ORIGIN in RPATH #260331
 +		x=$(
 +			find "${ED}" -type f '(' -perm -u+s -o -perm -g+s ')' -print0 | \
 +			xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; do \
 +			echo "${rpath}" | grep '$ORIGIN' > /dev/null 2>&1 && echo "${obj}"; done;
 +		)
 +		if [[ -n ${f}${x} ]] ; then
 +			__vecho -ne '\a\n'
 +			eqawarn "QA Notice: The following files contain insecure RUNPATH's"
 +			eqawarn " Please file a bug about this at http://bugs.gentoo.org/"
 +			eqawarn " with the maintaining herd of the package."
 +			eqawarn "${f}${f:+${x:+\n}}${x}"
 +			__vecho -ne '\a\n'
 +			if [[ -n ${x} ]] || has stricter ${FEATURES} ; then
 +				insecure_rpath=1
 +			else
 +				eqawarn "cannot automatically fix runpaths on interix platforms!"
 +			fi
 +		fi
 +
 +		rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 +		rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1
 +
 +		# Save NEEDED information after removing self-contained providers
 +		find "${ED}" -type f '(' ${_exec_find_opt} ')' -print0 | xargs -0 ${_pfx_scan} | { while IFS=';' read arch obj soname rpath needed; do
 +			# need to strip image dir from object name.
 +			obj="/${obj#${D}}"
 +			if [ -z "${rpath}" -o -n "${rpath//*ORIGIN*}" ]; then
 +				# object doesn't contain $ORIGIN in its runpath attribute
 +				echo "${obj} ${needed}"	>> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 +				echo "${arch};${obj};${soname};${rpath};${needed}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1
 +			else
 +				dir=${obj%/*}
 +				# replace $ORIGIN with the dirname of the current object for the lookup
 +				opath=$(echo :${rpath}: | sed -e "s#.*:\(.*\)\$ORIGIN\(.*\):.*#\1${dir}\2#")
 +				sneeded=$(echo ${needed} | tr , ' ')
 +				rneeded=""
 +				for lib in ${sneeded}; do
 +					found=0
 +					for path in ${opath//:/ }; do
 +						[ -e "${ED}/${path}/${lib}" ] && found=1 && break
 +					done
 +					[ "${found}" -eq 0 ] && rneeded="${rneeded},${lib}"
 +				done
 +				rneeded=${rneeded:1}
 +				if [ -n "${rneeded}" ]; then
 +					echo "${obj} ${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED
 +					echo "${arch};${obj};${soname};${rpath};${rneeded}" >> "${PORTAGE_BUILDDIR}"/build-info/NEEDED.PECOFF.1
 +				fi
 +			fi
 +		done }
 +		
 +		if [[ ${insecure_rpath} -eq 1 ]] ; then
 +			die "Aborting due to serious QA concerns with RUNPATH/RPATH"
 +		elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then
 +			die "Aborting due to QA concerns: ${die_msg}"
 +		fi
 +
 +		local _so_ext='.so*'
 +
 +		case "${CHOST}" in
 +			*-winnt*) _so_ext=".dll" ;; # no "*" intentionally!
 +		esac
 +
 +		# Run some sanity checks on shared libraries
 +		for d in "${ED}"lib* "${ED}"usr/lib* ; do
 +			[[ -d "${d}" ]] || continue
 +			f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \
 +				xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \
 +				do [[ -z "${soname}" ]] && echo "${obj}"; done)
 +			if [[ -n ${f} ]] ; then
 +				__vecho -ne '\a\n'
 +				eqawarn "QA Notice: The following shared libraries lack a SONAME"
 +				eqawarn "${f}"
 +				__vecho -ne '\a\n'
 +				sleep 1
 +			fi
 +
 +			f=$(find "${d}" -name "lib*${_so_ext}" -print0 | \
 +				xargs -0 ${_pfx_scan} | while IFS=";" read arch obj soname rpath needed; \
 +				do [[ -z "${needed}" ]] && echo "${obj}"; done)
 +			if [[ -n ${f} ]] ; then
 +				__vecho -ne '\a\n'
 +				eqawarn "QA Notice: The following shared libraries lack NEEDED entries"
 +				eqawarn "${f}"
 +				__vecho -ne '\a\n'
 +				sleep 1
 +			fi
 +		done
 +
 +		PORTAGE_QUIET=${tmp_quiet}
 +	fi
 +}
 +
 +install_qa_check_xcoff() {
 +	if ! has binchecks ${RESTRICT}; then
 +		local tmp_quiet=${PORTAGE_QUIET}
 +		local queryline deplib
 +		local insecure_rpath_list= undefined_symbols_list=
 +
 +		# display warnings when using stricter because we die afterwards
 +		if has stricter ${FEATURES} ; then
 +			unset PORTAGE_QUIET
 +		fi
 +
 +		rm -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED.XCOFF.1
 +
 +		local neededfd
 +		for neededfd in {3..1024} none; do ( : <&${neededfd} ) 2>/dev/null || break; done
 +		[[ ${neededfd} != none ]] || die "cannot find free file descriptor handle"
 +
 +		eval "exec ${neededfd}>\"${PORTAGE_BUILDDIR}\"/build-info/NEEDED.XCOFF.1" || die "cannot open ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1"
 +
 +		(	# work around a problem in /usr/bin/dump (used by aixdll-query)
 +			# dumping core when path names get too long.
 +			cd "${ED}" >/dev/null &&
 +			find . -not -type d -exec \
 +				aixdll-query '{}' FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS ';'
 +		) > "${T}"/needed 2>/dev/null
 +
 +		# Symlinking shared archive libraries is not a good idea on aix,
 +		# as there is nothing like "soname" on pure filesystem level.
 +		# So we create a copy instead of the symlink.
 +		local prev_FILE=
 +		local FILE MEMBER FLAGS FORMAT RUNPATH DEPLIBS
 +		while read queryline
 +		do
 +			FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS=
 +			eval ${queryline}
 +			FILE=${FILE#./}
 +
 +			if [[ ${prev_FILE} != ${FILE} ]]; then
 +				if [[ " ${FLAGS} " == *" SHROBJ "* && -h ${ED}${FILE} ]]; then
 +					prev_FILE=${FILE}
 +					local target=$(readlink "${ED}${FILE}")
 +					if [[ ${target} == /* ]]; then
 +						target=${D}${target}
 +					else
 +						target=${FILE%/*}/${target}
 +					fi
 +					rm -f "${ED}${FILE}" || die "cannot prune ${FILE}"
 +					cp -f "${ED}${target}" "${ED}${FILE}" || die "cannot copy ${target} to ${FILE}"
 +				fi
 +			fi
 +		done <"${T}"/needed
 +
 +		prev_FILE=
 +		while read queryline
 +		do
 +			FILE= MEMBER= FLAGS= FORMAT= RUNPATH= DEPLIBS=
 +			eval ${queryline}
 +			FILE=${FILE#./}
 +
 +			if [[ -n ${MEMBER} && ${prev_FILE} != ${FILE} ]]; then
 +				# Save NEEDED information for each archive library stub
 +				# even if it is static only: the already installed archive
 +				# may contain shared objects to be preserved.
 +				echo "${FORMAT##* }${FORMAT%%-*};${EPREFIX}/${FILE};${FILE##*/};;" >&${neededfd}
 +			fi
 +			prev_FILE=${FILE}
 +
 +			# shared objects have both EXEC and SHROBJ flags,
 +			# while executables have EXEC flag only.
 +			[[ " ${FLAGS} " == *" EXEC "* ]] || continue
 +
 +			# Make sure we disallow insecure RUNPATH's
 +			# Don't want paths that point to the tree where the package was built
 +			# (older, broken libtools would do this).  Also check for null paths
 +			# because the loader will search $PWD when it finds null paths.
 +			# And we really want absolute paths only.
 +			if [[ -n $(echo ":${RUNPATH}:" | grep -E "(${PORTAGE_BUILDDIR}|::|:[^/])") ]]; then
 +				insecure_rpath_list="${insecure_rpath_list}\n${FILE}${MEMBER:+[${MEMBER}]}"
 +			fi
 +
 +			local needed=
 +			[[ -n ${MEMBER} ]] && needed=${FILE##*/}
 +			for deplib in ${DEPLIBS}; do
 +				eval deplib=${deplib}
 +				if [[ ${deplib} == '.' || ${deplib} == '..' ]]; then
 +					# Although we do have runtime linking, we don't want undefined symbols.
 +					# AIX does indicate this by needing either '.' or '..'
 +					undefined_symbols_list="${undefined_symbols_list}\n${FILE}"
 +				else
 +					needed="${needed}${needed:+,}${deplib}"
 +				fi
 +			done
 +
 +			FILE=${EPREFIX}/${FILE}
 +
 +			[[ -n ${MEMBER} ]] && MEMBER="[${MEMBER}]"
 +			# Save NEEDED information
 +			echo "${FORMAT##* }${FORMAT%%-*};${FILE}${MEMBER};${FILE##*/}${MEMBER};${RUNPATH};${needed}" >&${neededfd}
 +		done <"${T}"/needed
 +
 +		eval "exec ${neededfd}>&-" || die "cannot close handle to ${PORTAGE_BUILDDIR}/build-info/NEEDED.XCOFF.1"
 +
 +		if [[ -n ${undefined_symbols_list} ]]; then
 +			__vecho -ne '\a\n'
 +			eqawarn "QA Notice: The following files contain undefined symbols."
 +			eqawarn " Please file a bug about this at http://bugs.gentoo.org/"
 +			eqawarn " with 'prefix' as the maintaining herd of the package."
 +			eqawarn "${undefined_symbols_list}"
 +			__vecho -ne '\a\n'
 +		fi
 +
 +		if [[ -n ${insecure_rpath_list} ]] ; then
 +			__vecho -ne '\a\n'
 +			eqawarn "QA Notice: The following files contain insecure RUNPATH's"
 +			eqawarn " Please file a bug about this at http://bugs.gentoo.org/"
 +			eqawarn " with 'prefix' as the maintaining herd of the package."
 +			eqawarn "${insecure_rpath_list}"
 +			__vecho -ne '\a\n'
 +			if has stricter ${FEATURES} ; then
 +				insecure_rpath=1
 +			fi
 +		fi
 +
 +		if [[ ${insecure_rpath} -eq 1 ]] ; then
 +			die "Aborting due to serious QA concerns with RUNPATH/RPATH"
 +		elif [[ -n ${die_msg} ]] && has stricter ${FEATURES} ; then
 +			die "Aborting due to QA concerns: ${die_msg}"
 +		fi
 +
 +		PORTAGE_QUIET=${tmp_quiet}
 +	fi
 +}
 +
+ __dyn_instprep() {
+ 	if [[ -e ${PORTAGE_BUILDDIR}/.instprepped ]] ; then
+ 		__vecho ">>> It appears that '$PF' is already instprepped; skipping."
+ 		__vecho ">>> Remove '${PORTAGE_BUILDDIR}/.instprepped' to force instprep."
+ 		return 0
+ 	fi
+ 
+ 	if has chflags ${FEATURES}; then
+ 		# Save all the file flags for restoration afterwards.
+ 		mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
+ 		# Remove all the file flags so that we can do anything necessary.
+ 		chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+ 		chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
+ 	fi
+ 
+ 	# If binpkg-docompress is disabled, we need to apply compression
+ 	# before installing.
+ 	if ! has binpkg-docompress ${FEATURES}; then
+ 		"${PORTAGE_BIN_PATH}"/ecompress --queue "${PORTAGE_DOCOMPRESS[@]}"
+ 		"${PORTAGE_BIN_PATH}"/ecompress --ignore "${PORTAGE_DOCOMPRESS_SKIP[@]}"
+ 		"${PORTAGE_BIN_PATH}"/ecompress --dequeue
+ 	fi
+ 
+ 	# If binpkg-dostrip is disabled, apply stripping before creating
+ 	# the binary package.
+ 	if ! has binpkg-dostrip ${FEATURES}; then
+ 		export STRIP_MASK
+ 		if ___eapi_has_dostrip; then
+ 			"${PORTAGE_BIN_PATH}"/estrip --queue "${PORTAGE_DOSTRIP[@]}"
+ 			"${PORTAGE_BIN_PATH}"/estrip --ignore "${PORTAGE_DOSTRIP_SKIP[@]}"
+ 			"${PORTAGE_BIN_PATH}"/estrip --dequeue
+ 		else
+ 			prepallstrip
+ 		fi
+ 	fi
+ 
+ 	if has chflags ${FEATURES}; then
+ 		# Restore all the file flags that were saved earlier on.
+ 		mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
+ 	fi
+ 
+ 	>> "${PORTAGE_BUILDDIR}/.instprepped" || \
+ 		die "Failed to create ${PORTAGE_BUILDDIR}/.instprepped"
+ }
+ 
  preinst_qa_check() {
  	postinst_qa_check preinst
  }


             reply	other threads:[~2018-12-12 18:54 UTC|newest]

Thread overview: 195+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-12 18:54 Fabian Groffen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-25  9:40 [gentoo-commits] proj/portage:prefix commit in: / Fabian Groffen
2024-02-22  7:27 Fabian Groffen
2024-01-18 10:22 Fabian Groffen
2024-01-18  9:36 Fabian Groffen
2023-12-03 10:10 Fabian Groffen
2023-12-03  9:54 Fabian Groffen
2023-12-03  9:54 Fabian Groffen
2023-12-03  9:54 Fabian Groffen
2023-11-24 20:18 Fabian Groffen
2023-11-24 20:06 Fabian Groffen
2023-11-24 20:06 Fabian Groffen
2023-06-22  8:47 Fabian Groffen
2023-06-17  9:04 Fabian Groffen
2023-06-17  8:41 Fabian Groffen
2022-07-28 17:38 Fabian Groffen
2022-07-27 19:20 Fabian Groffen
2022-07-26 19:39 Fabian Groffen
2022-07-25 15:20 Fabian Groffen
2022-07-24 19:27 Fabian Groffen
2022-07-24 14:01 Fabian Groffen
2022-07-24  9:45 Fabian Groffen
2022-01-14 10:40 Fabian Groffen
2022-01-14 10:32 Fabian Groffen
2021-07-06  7:10 Fabian Groffen
2021-04-16 13:37 Fabian Groffen
2021-01-24  9:02 Fabian Groffen
2021-01-04 10:48 Fabian Groffen
2020-12-07 17:28 Fabian Groffen
2020-12-07 16:46 Fabian Groffen
2020-11-23  7:48 Fabian Groffen
2020-11-22 11:15 Fabian Groffen
2020-09-26 11:29 Fabian Groffen
2020-08-02 12:33 Fabian Groffen
2020-06-02 18:55 Fabian Groffen
2020-01-08 19:14 Fabian Groffen
2019-07-01 13:11 Fabian Groffen
2019-05-30  9:20 Fabian Groffen
2019-02-28 12:31 Fabian Groffen
2019-01-11 10:19 Fabian Groffen
2019-01-07 10:22 Fabian Groffen
2018-12-23 11:14 Fabian Groffen
2018-08-04  6:56 Fabian Groffen
2018-06-25  8:34 Fabian Groffen
2018-06-17 14:38 Fabian Groffen
2018-06-17 14:38 Fabian Groffen
2018-05-28 15:24 Fabian Groffen
2018-05-25 19:44 Fabian Groffen
2018-05-25 19:44 Fabian Groffen
2018-05-18 19:46 Fabian Groffen
2017-12-12  8:19 Fabian Groffen
2017-10-29 14:51 Fabian Groffen
2017-10-03  7:32 Fabian Groffen
2017-09-22 10:08 Fabian Groffen
2017-08-21 13:27 Fabian Groffen
2017-08-13  7:21 Fabian Groffen
2017-05-23 13:34 Fabian Groffen
2017-03-25  9:12 Fabian Groffen
2017-03-24 19:09 Fabian Groffen
2017-03-24  7:43 Fabian Groffen
2017-03-23 17:46 Fabian Groffen
2017-03-23 17:32 Fabian Groffen
2017-03-23 17:23 Fabian Groffen
2017-03-23 15:38 Fabian Groffen
2017-03-17  8:25 Fabian Groffen
2017-03-02  8:48 Fabian Groffen
2017-03-02  8:18 Fabian Groffen
2017-02-23 14:05 Fabian Groffen
2017-01-27 15:08 Fabian Groffen
2017-01-27 15:08 Fabian Groffen
2016-03-20 19:31 Fabian Groffen
2016-02-21 16:17 Fabian Groffen
2016-02-21 16:17 Fabian Groffen
2016-02-18 19:35 Fabian Groffen
2016-02-18 19:35 Fabian Groffen
2015-06-20  7:12 Fabian Groffen
2015-06-09 18:30 Fabian Groffen
2015-06-09 18:01 Fabian Groffen
2015-06-04 19:47 Fabian Groffen
2015-04-05  9:15 Fabian Groffen
2014-11-12 17:31 Fabian Groffen
2014-10-02 18:48 Fabian Groffen
2014-09-28 17:52 Fabian Groffen
2014-05-06 19:32 Fabian Groffen
2014-05-06 19:18 Fabian Groffen
2014-04-22 19:52 Fabian Groffen
2014-02-06 21:09 Fabian Groffen
2014-01-06  9:47 Fabian Groffen
2013-09-24 17:29 Fabian Groffen
2013-09-20 17:59 Fabian Groffen
2013-09-18 18:34 Fabian Groffen
2013-09-13 18:02 Fabian Groffen
2013-08-10 20:54 Fabian Groffen
2013-07-10  5:31 Fabian Groffen
2013-07-08 19:32 Fabian Groffen
2013-06-29  5:41 Fabian Groffen
2013-06-27 17:20 Fabian Groffen
2013-06-12  9:02 Fabian Groffen
2013-06-09 15:53 Fabian Groffen
2013-05-04 18:55 Fabian Groffen
2013-04-02 16:57 Fabian Groffen
2013-03-31 19:03 Fabian Groffen
2013-03-31 19:00 Fabian Groffen
2013-03-24  8:36 Fabian Groffen
2013-03-23 19:54 Fabian Groffen
2013-02-28 19:29 Fabian Groffen
2013-02-07 20:01 Fabian Groffen
2013-01-27 21:41 Fabian Groffen
2013-01-27 21:41 Fabian Groffen
2013-01-13 10:26 Fabian Groffen
2013-01-10 21:02 Fabian Groffen
2013-01-05 18:14 Fabian Groffen
2012-12-26 14:48 Fabian Groffen
2012-12-02 15:47 Fabian Groffen
2012-12-02 15:36 Fabian Groffen
2012-12-02 15:33 Fabian Groffen
2012-12-02 15:33 Fabian Groffen
2012-12-02 15:33 Fabian Groffen
2012-12-02 13:12 Fabian Groffen
2012-12-02 12:59 Fabian Groffen
2012-11-04 10:48 Fabian Groffen
2012-10-22 17:25 Fabian Groffen
2012-10-02 12:02 Fabian Groffen
2012-09-30 11:22 Fabian Groffen
2012-09-26 18:26 Fabian Groffen
2012-09-12 18:18 Fabian Groffen
2012-09-09  7:40 Fabian Groffen
2012-09-06 18:14 Fabian Groffen
2012-08-27  6:44 Fabian Groffen
2012-08-12  7:50 Fabian Groffen
2012-07-19 16:25 Fabian Groffen
2012-07-06  7:05 Fabian Groffen
2012-04-23 19:23 Fabian Groffen
2012-04-03 18:04 Fabian Groffen
2012-03-31 19:31 Fabian Groffen
2012-03-01 20:32 Fabian Groffen
2012-02-19  9:58 Fabian Groffen
2012-02-09  8:01 Fabian Groffen
2012-01-10 17:45 Fabian Groffen
2011-12-31 16:45 Fabian Groffen
2011-12-26  9:12 Fabian Groffen
2011-12-23  9:51 Fabian Groffen
2011-12-22  9:51 Fabian Groffen
2011-12-19 18:30 Fabian Groffen
2011-12-14 15:25 Fabian Groffen
2011-12-10 11:28 Fabian Groffen
2011-12-09 20:33 Fabian Groffen
2011-12-02 20:31 Fabian Groffen
2011-12-02 19:20 Fabian Groffen
2011-12-02 19:19 Fabian Groffen
2011-12-02 19:18 Fabian Groffen
2011-12-02 18:03 Fabian Groffen
2011-10-21 17:34 Fabian Groffen
2011-10-21 17:34 Fabian Groffen
2011-10-20 20:28 Fabian Groffen
2011-10-20 17:08 Fabian Groffen
2011-10-20 16:38 Fabian Groffen
2011-10-17 18:36 Fabian Groffen
2011-10-16 13:59 Fabian Groffen
2011-10-15 18:27 Fabian Groffen
2011-10-13  6:52 Fabian Groffen
2011-09-23 18:38 Fabian Groffen
2011-09-23 18:23 Fabian Groffen
2011-09-20 18:25 Fabian Groffen
2011-09-14 18:43 Fabian Groffen
2011-09-14 18:38 Fabian Groffen
2011-09-13 17:41 Fabian Groffen
2011-08-31 18:39 Fabian Groffen
2011-08-30 18:45 Fabian Groffen
2011-08-29 19:03 Fabian Groffen
2011-08-25 20:25 Fabian Groffen
2011-08-20 17:50 Fabian Groffen
2011-07-26 17:35 Fabian Groffen
2011-07-17  9:48 Fabian Groffen
2011-07-17  8:12 Fabian Groffen
2011-07-01 17:44 Fabian Groffen
2011-06-14 15:39 Fabian Groffen
2011-06-06 17:12 Fabian Groffen
2011-05-28  8:29 Fabian Groffen
2011-05-27 17:41 Fabian Groffen
2011-05-14 13:59 Fabian Groffen
2011-05-02 17:41 Fabian Groffen
2011-04-24 12:08 Fabian Groffen
2011-04-15 18:27 Fabian Groffen
2011-04-15 18:27 Fabian Groffen
2011-03-28 16:52 Fabian Groffen
2011-03-23 19:26 Fabian Groffen
2011-03-17 19:08 Fabian Groffen
2011-03-13 14:45 Fabian Groffen
2011-03-09 19:44 Fabian Groffen
2011-02-26 21:15 Fabian Groffen
2011-02-10 18:46 Fabian Groffen
2011-02-10 18:44 Fabian Groffen
2011-02-10 18:20 Fabian Groffen
2011-02-05 12:25 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1544102535.1b9bf9900acb9fe2b2f337e4947c6f290a8ccfa4.grobian@gentoo \
    --to=grobian@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox