commit:     9abebd3e6aae049d2eb9c8039453d7f187bca00f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed May 16 16:48:16 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May 16 16:51:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9abebd3e

phase-helpers.sh: fix ROOT overrides for has/best_version (bug 655860)

Since it's common for code to override the ROOT variable, use
${ROOT%/}/${EPREFIX} instead of ${EROOT}. Thanks to Mike Gilbert
<floppym <AT> gentoo.org> for finding the cause.

Fixes: 43b6be7423aa ("phase-helpers.sh: Implement -r|-d|-b options for 
best/has_version")
Bug: https://bugs.gentoo.org/655860

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 59c19cf67..9163ef014 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -891,7 +891,7 @@ ___best_version_and_has_version_common() {
 
        case ${root_arg} in
                "") if ___eapi_has_prefix_variables; then
-                               root=${EROOT}
+                               root=${ROOT%/}/${EPREFIX}
                        else
                                root=${ROOT}
                        fi ;;
@@ -910,7 +910,7 @@ ___best_version_and_has_version_common() {
                        fi
                        if ___eapi_has_prefix_variables; then
                                case ${root_arg} in
-                                       -r) root=${EROOT} ;;
+                                       -r) root=${ROOT%/}/${EPREFIX} ;;
                                        -d) root=${ESYSROOT} ;;
                                        -b) root=${BROOT:-/} ;;
                                esac

Reply via email to