From: Zac Medico Date: Wed, 2 Nov 2011 04:57:10 +0000 (-0700) Subject: phase-helpers.sh: fix best/has_version for prefix X-Git-Tag: v2.2.0_alpha73~28 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ab484dc9a2612aa6709fad3ff926c8589a706637;p=portage.git phase-helpers.sh: fix best/has_version for prefix --- diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 8a2f381c3..a47064e37 100644 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@ -600,11 +600,13 @@ _eapi4_src_install() { # Takes single depend-type atoms. has_version() { + local eroot=${EROOT} + case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then - "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "$ROOT" "$1" + "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "$1" else PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${ROOT}" "$1" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" has_version "${eroot}" "$1" fi local retval=$? case "${retval}" in @@ -621,11 +623,13 @@ has_version() { # Takes single depend-type atoms. best_version() { + local eroot=${EROOT} + case "$EAPI" in 0|1|2) eroot=${ROOT} ;; esac if [[ -n $PORTAGE_IPC_DAEMON ]] ; then - "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "$ROOT" "$1" + "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "$1" else PYTHONPATH=${PORTAGE_PYM_PATH}${PYTHONPATH:+:}${PYTHONPATH} \ - "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${ROOT}" "$1" + "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/portageq" best_version "${eroot}" "$1" fi local retval=$? case "${retval}" in