commit:     96b0650dfe6ec38d1c02541d20b0adaf492032d9
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Tue Jul  3 08:49:01 2018 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Tue Jul  3 08:49:01 2018 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=96b0650d

python-utils-r1.eclass: switch to stacked-prefix feature

USE=prefix-chain now is FEATURES=stacked-prefix
Bug: https://bugs.gentoo.org/658572

 eclass/python-utils-r1.eclass | 54 +++++++++++++++----------------------------
 1 file changed, 18 insertions(+), 36 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index ed84c2680c..6a70453cbe 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -388,36 +388,24 @@ python_export() {
                        PYTHON)
                                export PYTHON=${EPREFIX}/usr/bin/${impl}
                                if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-                               && [[ ! -x ${PYTHON} ]] \
-                               && use prefix-chain; then
-                                       # Need to search in parent prefixes
-                                       local parent
-                                       local parents=()
-                                       IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-                                       for parent in "${parents[@]}"; do
-                                               if [[ -x 
${parent}/usr/bin/${impl} ]]; then
-                                                       
PYTHON=${parent}/usr/bin/${impl}
-                                                       break
-                                               fi
-                                       done
+                               && [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
+                               && has stacked-prefix ${FEATURES}; then
+                                       # Need to look in build prefix
+                                       if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then
+                                               
PYTHON=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl}
+                                       fi
                                fi
                                debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
                                ;;
                        PYTHON_EPREFIX)
                                export PYTHON_EPREFIX=${EPREFIX}
                                if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-                               && [[ ! -x ${PYTHON_EPREFIX}/usr/bin/${impl} ]] 
\
-                               && use prefix-chain; then
-                                       # Need to search in parent prefixes
-                                       local parent
-                                       local parents=()
-                                       IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-                                       for parent in "${parents[@]}"; do
-                                               if [[ -x 
${parent}/usr/bin/${impl} ]]; then
-                                                       PYTHON_EPREFIX=${parent}
-                                                       break
-                                               fi
-                                       done
+                               && [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
+                               && has stacked-prefix ${FEATURES}; then
+                                       # Need to look in build prefix
+                                       if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then
+                                               
PYTHON_EPREFIX=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}
+                                       fi
                                fi
                                debug-print "${FUNCNAME}: PYTHON_EPREFIX = 
${PYTHON_EPREFIX}"
                                ;;
@@ -531,18 +519,12 @@ python_export() {
                                local dir
                                export 
PYTHON_SCRIPTDIR=${EPREFIX}/usr/lib/python-exec/${impl}
                                if [[ " python jython pypy pypy3 " != *" ${PN} 
"* ]] \
-                               && [[ ! -d ${PYTHON_SCRIPTDIR} ]] \
-                               && use prefix-chain; then
-                                       # Need to search in parent prefixes
-                                       local parent
-                                       local parents=()
-                                       IFS=: eval 
'parents=(${PORTAGE_READONLY_EPREFIXES})'
-                                       for parent in "${parents[@]}"; do
-                                               if [[ -e 
${parent}/usr/lib/python-exec/${impl} ]]; then
-                                                       
PYTHON_SCRIPTDIR=${parent}/usr/lib/python-exec/${impl}
-                                                       break
-                                               fi
-                                       done
+                               && [[ ! -x ${EPREFIX}/usr/bin/${impl} ]] \
+                               && has stacked-prefix ${FEATURES}; then
+                                       # Need to look in build prefix
+                                       if [[ -x 
${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/bin/${impl} ]]; then
+                                               
PYTHON_SCRIPTDIR=${BROOT-${PORTAGE_OVERRIDE_EPREFIX}}/usr/lib/python-exec/${impl}
+                                       fi
                                fi
                                debug-print "${FUNCNAME}: PYTHON_SCRIPTDIR = 
${PYTHON_SCRIPTDIR}"
                                ;;

Reply via email to