From ab484dc9a2612aa6709fad3ff926c8589a706637 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Nov 2011 21:57:10 -0700 Subject: [PATCH] phase-helpers.sh: fix best/has_version for prefix --- bin/phase-helpers.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.26.2