From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RNUgE-0000BQ-NS for garchives@archives.gentoo.org; Mon, 07 Nov 2011 19:16:30 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5EC2621C068; Mon, 7 Nov 2011 19:16:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2FCC321C068 for ; Mon, 7 Nov 2011 19:16:18 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A8F201B4031 for ; Mon, 7 Nov 2011 19:16:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 1C7C380042 for ; Mon, 7 Nov 2011 19:16:17 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/phase-helpers.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b58e5fd407c8726fd2ffe674444255aab9ae0010 Date: Mon, 7 Nov 2011 19:16:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 391783b6-0bad-44c6-ac39-4b1622b8df78 X-Archives-Hash: 5a69df715f58ffab9cb692e20d55dd08 commit: b58e5fd407c8726fd2ffe674444255aab9ae0010 Author: Zac Medico gentoo org> AuthorDate: Mon Nov 7 19:16:09 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Nov 7 19:16:09 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db58e5fd4 Fix best/has_version ROOT override for EAPI 3-4. This has been broken since commit ab484dc9a2612aa6709fad3ff926c8589a706637. In order to support prefix, callers will have to override EROOT instead. --- bin/phase-helpers.sh | 46 ++++++++++++++++++++++++++++++++++++++++----= -- 1 files changed, 40 insertions(+), 6 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index a47064e..5d2d5dd 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -596,12 +596,29 @@ _eapi4_src_install() { fi } =20 -# Return true if given package is installed. Otherwise return false. -# Takes single depend-type atoms. +# @FUNCTION: has_version +# @USAGE: +# @DESCRIPTION: +# Returns the best/most-current match. Callers may override the ROOT +# variable in order match packages from an alternative ROOT. In +# EAPI 3 and later, override EROOT instead (ROOT override is supported +# in this case only if EPREFIX is empty). has_version() { =20 local eroot=3D${EROOT} - case "$EAPI" in 0|1|2) eroot=3D${ROOT} ;; esac + case "$EAPI" in + 0|1|2) + eroot=3D${ROOT} + ;; + *) + if [[ -z ${EPREFIX} && ${EROOT} !=3D ${ROOT} ]] ; then + # Handle ROOT environment override, which ebuilds + # sometimes use for stage1/cross-compiling. + # In order to support prefix, they'll have to + # override EROOT instead. + eroot=3D${ROOT} + fi + esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1" else @@ -619,12 +636,29 @@ has_version() { esac } =20 -# Returns the best/most-current match. -# Takes single depend-type atoms. +# @FUNCTION: best_version +# @USAGE: +# @DESCRIPTION: +# Returns the best/most-current match. Callers may override the ROOT +# variable in order match packages from an alternative ROOT. In +# EAPI 3 and later, override EROOT instead (ROOT override is supported +# in this case only if EPREFIX is empty). best_version() { =20 local eroot=3D${EROOT} - case "$EAPI" in 0|1|2) eroot=3D${ROOT} ;; esac + case "$EAPI" in + 0|1|2) + eroot=3D${ROOT} + ;; + *) + if [[ -z ${EPREFIX} && ${EROOT} !=3D ${ROOT} ]] ; then + # Handle ROOT environment override, which ebuilds + # sometimes use for stage1/cross-compiling. + # In order to support prefix, they'll have to + # override EROOT instead. + eroot=3D${ROOT} + fi + esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1" else