From: Fabian Groffen Date: Sun, 30 Sep 2012 11:19:55 +0000 (+0200) Subject: Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be56a2b322aa6149ec6c0873c44121b5ae0a2933;p=portage.git Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Conflicts: bin/ebuild-helpers/dobin bin/ebuild-helpers/dodir bin/ebuild-helpers/dodoc bin/ebuild-helpers/doexe bin/ebuild-helpers/doinfo bin/ebuild-helpers/dolib bin/ebuild-helpers/doman bin/ebuild-helpers/domo bin/ebuild-helpers/dosbin bin/ebuild-helpers/ecompressdir bin/ebuild-helpers/fperms bin/ebuild-helpers/prepall bin/ebuild-helpers/prepallinfo bin/ebuild-helpers/prepallman bin/ebuild-helpers/prepallstrip bin/ebuild-helpers/prepinfo bin/ebuild-helpers/preplib bin/ebuild-helpers/prepman bin/ebuild.sh bin/misc-functions.sh --- be56a2b322aa6149ec6c0873c44121b5ae0a2933 diff --cc bin/ebuild-helpers/dobin index 3d81c2d28,0ba1eb0c4..2d3858078 --- a/bin/ebuild-helpers/dobin +++ b/bin/ebuild-helpers/dobin @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/dodir index 3b9a1716a,e03ba9a58..779bcccb7 --- a/bin/ebuild-helpers/dodir +++ b/bin/ebuild-helpers/dodir @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi install -d ${DIROPTIONS} "${@/#/${ED}/}" ret=$? diff --cc bin/ebuild-helpers/dodoc index 7f5e364a4,c551735eb..4c1c7bcd6 --- a/bin/ebuild-helpers/dodoc +++ b/bin/ebuild-helpers/dodoc @@@ -2,19 -2,15 +2,15 @@@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 - case "${EAPI}" in - 0|1|2|3) - ;; - *) - exec \ - env \ - __PORTAGE_HELPER="dodoc" \ - doins "$@" - ;; - esac - -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh + if ___eapi_dodoc_supports_-r; then + exec \ + env \ + __PORTAGE_HELPER="dodoc" \ + doins "$@" + fi + if [ $# -lt 1 ] ; then __helpers_die "${0##*/}: at least one argument needed" exit 1 diff --cc bin/ebuild-helpers/doexe index 9c845ca0e,aa050e9ed..7ada92d05 --- a/bin/ebuild-helpers/doexe +++ b/bin/ebuild-helpers/doexe @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/doinfo index db49bedce,355047f73..816337f1c --- a/bin/ebuild-helpers/doinfo +++ b/bin/ebuild-helpers/doinfo @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ -z $1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/doins index 343a150b2,4679e83a9..1fdc1d91b --- a/bin/ebuild-helpers/doins +++ b/bin/ebuild-helpers/doins @@@ -40,24 -41,12 +41,21 @@@ if [[ ${INSDESTTREE#${ED}} != "${INSDES __helpers_die "${helper} used with \${D} or \${ED}" exit 1 fi +# PREFIX LOCAL: check for usage with EPREFIX +if [[ ${INSDESTTREE#${EPREFIX}} != "${INSDESTTREE}" ]]; then + vecho "-------------------------------------------------------" 1>&2 + vecho "You should not use \${EPREFIX} with helpers." 1>&2 + vecho " --> ${INSDESTTREE}" 1>&2 + vecho "-------------------------------------------------------" 1>&2 + exit 1 +fi +# END PREFIX LOCAL - case "$EAPI" in - 0|1|2|3) - PRESERVE_SYMLINKS=n - ;; - *) - PRESERVE_SYMLINKS=y - ;; - esac + if ___eapi_doins_and_newins_preserve_symlinks; then + PRESERVE_SYMLINKS=y + else + PRESERVE_SYMLINKS=n + fi export TMP=$T/.doins_tmp # Use separate directories to avoid potential name collisions. diff --cc bin/ebuild-helpers/dolib index 67055bb55,fd92d7f03..f161f725b --- a/bin/ebuild-helpers/dolib +++ b/bin/ebuild-helpers/dolib @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi # Setup ABI cruft LIBDIR_VAR="LIBDIR_${ABI}" diff --cc bin/ebuild-helpers/doman index dd5440d7b,d6808597a..8273cae33 --- a/bin/ebuild-helpers/doman +++ b/bin/ebuild-helpers/doman @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/domo index 82469733f,9a8dda38a..bb9fca2c6 --- a/bin/ebuild-helpers/domo +++ b/bin/ebuild-helpers/domo @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh mynum=${#} if [ ${mynum} -lt 1 ] ; then diff --cc bin/ebuild-helpers/dosbin index 9765b7529,361ca83ca..0ddd65510 --- a/bin/ebuild-helpers/dosbin +++ b/bin/ebuild-helpers/dosbin @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh if [[ $# -lt 1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/ecompressdir index 464dd378c,75f3e3a25..83bf7fedc --- a/bin/ebuild-helpers/ecompressdir +++ b/bin/ebuild-helpers/ecompressdir @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/helper-functions.sh if [[ -z $1 ]] ; then __helpers_die "${0##*/}: at least one argument needed" diff --cc bin/ebuild-helpers/fowners index 8066ab700,cee4108ce..0aef37892 --- a/bin/ebuild-helpers/fowners +++ b/bin/ebuild-helpers/fowners @@@ -2,11 -2,11 +2,12 @@@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh + - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) EPREFIX= ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + EPREFIX= ED=${D} + fi # we can't prefix all arguments because # chown takes random options diff --cc bin/ebuild-helpers/fperms index 0824c15fc,d854ebbdf..94f6af22f --- a/bin/ebuild-helpers/fperms +++ b/bin/ebuild-helpers/fperms @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi # we can't prefix all arguments because # chmod takes random options diff --cc bin/ebuild-helpers/prepall index 3aacb7f2a,fb5c2db55..407392f01 --- a/bin/ebuild-helpers/prepall +++ b/bin/ebuild-helpers/prepall @@@ -1,13 -1,12 +1,14 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh + +[[ -d ${ED} ]] || exit 0 - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi if has chflags $FEATURES ; then # Save all the file flags for restoration at the end of prepall. diff --cc bin/ebuild-helpers/prepalldocs index 2804987ef,3094661f5..c7c85d62d --- a/bin/ebuild-helpers/prepalldocs +++ b/bin/ebuild-helpers/prepalldocs @@@ -2,16 -2,12 +2,12 @@@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - case "${EAPI}" in - 0|1|2|3) - ;; - *) - die "'${0##*/}' has been banned for EAPI '$EAPI'" - exit 1 - ;; - esac + if ___eapi_has_docompress; then + die "'${0##*/}' has been banned for EAPI '$EAPI'" + exit 1 + fi if [[ -n $1 ]] ; then __vecho "${0##*/}: invalid usage; takes no arguments" 1>&2 diff --cc bin/ebuild-helpers/prepallinfo index 00e1fc41c,1a2027580..43d0980b7 --- a/bin/ebuild-helpers/prepallinfo +++ b/bin/ebuild-helpers/prepallinfo @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi [[ -d ${ED}usr/share/info ]] || exit 0 diff --cc bin/ebuild-helpers/prepallman index fbc2f1dcf,7c78324cd..4ad3a5eb4 --- a/bin/ebuild-helpers/prepallman +++ b/bin/ebuild-helpers/prepallman @@@ -1,14 -1,15 +1,15 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh # replaced by controllable compression in EAPI 4 - has "${EAPI}" 0 1 2 3 || exit 0 + ___eapi_has_docompress && exit 0 - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi ret=0 diff --cc bin/ebuild-helpers/prepallstrip index f99a15b0d,1aa6686cd..d80f27ae1 --- a/bin/ebuild-helpers/prepallstrip +++ b/bin/ebuild-helpers/prepallstrip @@@ -1,8 -1,11 +1,11 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh ++source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh + + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi exec prepstrip "${ED}" diff --cc bin/ebuild-helpers/prepinfo index 4ae497630,5afc18a71..170e18a47 --- a/bin/ebuild-helpers/prepinfo +++ b/bin/ebuild-helpers/prepinfo @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi if [[ -z $1 ]] ; then infodir="/usr/share/info" diff --cc bin/ebuild-helpers/preplib index 8e3d4b30a,764261d98..145540c61 --- a/bin/ebuild-helpers/preplib +++ b/bin/ebuild-helpers/preplib @@@ -1,8 -1,8 +1,8 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh eqawarn "QA Notice: Deprecated call to 'preplib'" diff --cc bin/ebuild-helpers/prepman index 1411499ab,142d40443..add01c878 --- a/bin/ebuild-helpers/prepman +++ b/bin/ebuild-helpers/prepman @@@ -1,11 -1,12 +1,12 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2011 Gentoo Foundation + # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}"/isolated-functions.sh - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + ED=${D} + fi if [[ -z $1 ]] ; then mandir="${ED}usr/share/man" diff --cc bin/misc-functions.sh index b66ded412,986264ed8..3b2c3092b mode 100644,100755..100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@@ -14,14 -14,12 +14,16 @@@ MISC_FUNCTIONS_ARGS="$@" shift $# -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/ebuild.sh" +source "${PORTAGE_BIN_PATH:-@PORTAGE_BASE@/bin}/ebuild.sh" install_symlink_html_docs() { - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) local ED=${D} ;; esac - # PREFIX LOCAL: ED needs not to exist, whereas D does - [[ ! -d ${ED} && -d ${D} ]] && dodir / - # END PREFIX LOCAL + if ! ___eapi_has_prefix_variables; then + local ED=${D} ++ else ++ # PREFIX LOCAL: ED needs not to exist, whereas D does ++ [[ ! -d ${ED} && -d ${D} ]] && dodir / ++ # END PREFIX LOCAL + fi cd "${ED}" || die "cd failed" #symlink the html documentation (if DOC_SYMLINKS_DIR is set in make.conf) if [ -n "${DOC_SYMLINKS_DIR}" ] ; then @@@ -165,12 -164,11 +168,13 @@@ prepcompress() install_qa_check() { local f i qa_var x - [[ " ${FEATURES} " == *" force-prefix "* ]] || \ - case "$EAPI" in 0|1|2) local EPREFIX= ED=${D} ;; esac + if ! ___eapi_has_prefix_variables; then + local EPREFIX= ED=${D} + fi - cd "${ED}" || die "cd failed" + # PREFIX LOCAL: ED needs not to exist, whereas D does + cd "${D}" || die "cd failed" + # END PREFIX LOCAL qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}" eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")" diff --cc pym/portage/package/ebuild/doebuild.py index 84e4494b9,9deed98d7..2db7900b1 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@@ -152,11 -150,18 +152,15 @@@ def _doebuild_path(settings, eapi=None) eprefix = settings["EPREFIX"] prerootpath = [x for x in settings.get("PREROOTPATH", "").split(":") if x] rootpath = [x for x in settings.get("ROOTPATH", "").split(":") if x] - - prefixes = [] - if eprefix: - prefixes.append(eprefix) - prefixes.append("/") - + # PREFIX LOCAL: use DEFAULT_PATH and EXTRA_PATH from make.globals + defaultpath = [x for x in settings.get("DEFAULT_PATH", "").split(":") if x] + extrapath = [x for x in settings.get("EXTRA_PATH", "").split(":") if x] path = [] + if eprefix and uid != 0 and "fakeroot" not in settings.features: + path.append(os.path.join(portage_bin_path, + "ebuild-helpers", "unprivileged")) + if settings.get("USERLAND", "GNU") != "GNU": path.append(os.path.join(portage_bin_path, "ebuild-helpers", "bsd"))