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 1RNVgJ-0007qm-9y for garchives@archives.gentoo.org; Mon, 07 Nov 2011 20:20:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F3C1721C02A; Mon, 7 Nov 2011 20:20:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AAB0A21C02A for ; Mon, 7 Nov 2011 20:20:25 +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 18CCF1B4026 for ; Mon, 7 Nov 2011 20:20:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 7B6BC80042 for ; Mon, 7 Nov 2011 20:20:24 +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: d00e6b124b8709269de1c66d889c79bd8f91fa88 Date: Mon, 7 Nov 2011 20:20:24 +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: 9f9986d1-9d61-41f7-a880-2052bcf9fe1c X-Archives-Hash: 470cd912ba8e8812e79f6486bddc798c commit: d00e6b124b8709269de1c66d889c79bd8f91fa88 Author: Zac Medico gentoo org> AuthorDate: Mon Nov 7 20:19:53 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Nov 7 20:20:18 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Dd00e6b12 Only support ROOT override for best/has_version. In the context of ebuilds, ROOT=3D/ override is the only common case, so it makes sense to only support ROOT overrides. --- bin/phase-helpers.sh | 36 ++++++++++++------------------------ 1 files changed, 12 insertions(+), 24 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 5d2d5dd..6609dc7 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -599,25 +599,19 @@ _eapi4_src_install() { # @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). +# Return true if given package is installed. Otherwise return false. +# Callers may override the ROOT variable in order match packages from an +# alternative ROOT. has_version() { =20 - local eroot=3D${EROOT} + local eroot 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 + eroot=3D${ROOT%/}${EPREFIX#/}/ + ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1" @@ -639,25 +633,19 @@ has_version() { # @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). +# Returns the best/most-current match. +# Callers may override the ROOT variable in order match packages from an +# alternative ROOT. best_version() { =20 - local eroot=3D${EROOT} + local eroot 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 + eroot=3D${ROOT%/}${EPREFIX#/}/ + ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1"