From: Arfrever Frehtes Taifersar Arahesis Date: Tue, 16 Jul 2013 17:50:59 +0000 (+0200) Subject: Stop using PORTDIR_OVERLAY in bash part of Portage. X-Git-Tag: v2.2.0_alpha189~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e72b8b90542d1ed2bf53c2b9a0491795c12e63c2;p=portage.git Stop using PORTDIR_OVERLAY in bash part of Portage. --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index cb5fca733..fc7fd9e09 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -207,8 +207,10 @@ inherit() { | fmt -w 75 | while read -r ; do eqawarn "$REPLY" ; done fi + local repo + local repo_location local location - local olocation + local potential_location local x # These variables must be restored before returning. @@ -222,8 +224,8 @@ inherit() { local B_PDEPEND local B_HDEPEND while [ "$1" ]; do - location="${ECLASSDIR}/${1}.eclass" - olocation="" + location="" + potential_location="" export ECLASS="$1" __export_funcs_var=__export_functions_$ECLASS_DEPTH @@ -244,24 +246,16 @@ inherit() { fi fi - # any future resolution code goes here - if [ -n "$PORTDIR_OVERLAY" ]; then - local overlay - for overlay in ${PORTDIR_OVERLAY}; do - olocation="${overlay}/eclass/${1}.eclass" - if [ -e "$olocation" ]; then - location="${olocation}" - debug-print " eclass exists: ${location}" - fi - done - fi + for repo in $(__repo_key ${PORTAGE_REPO_NAME} masters) ${PORTAGE_REPO_NAME} $(__repo_key ${PORTAGE_REPO_NAME} eclass-overrides); do + repo_location="$(__repo_key ${repo} location)" + potential_location="${repo_location}/eclass/${1}.eclass" + if [[ -f ${potential_location} ]]; then + location="${potential_location}" + debug-print " eclass exists: ${location}" + fi + done debug-print "inherit: $1 -> $location" - [ ! -e "$location" ] && die "${1}.eclass could not be found by inherit()" - - if [ "${location}" == "${olocation}" ] && \ - ! has "${location}" ${EBUILD_OVERLAY_ECLASSES} ; then - EBUILD_OVERLAY_ECLASSES="${EBUILD_OVERLAY_ECLASSES} ${location}" - fi + [[ -z ${location} ]] && die "${1}.eclass could not be found by inherit()" #We need to back up the values of *DEPEND to B_*DEPEND #(if set).. and then restore them after the inherit call. diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 1f8a27ebb..61ed8b772 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}/eapi.sh" @@ -176,13 +176,6 @@ die() { fi eerror "If you need support, post the output of \`emerge --info '=$CATEGORY/$PF'\`," eerror "the complete build log and the output of \`emerge -pqv '=$CATEGORY/$PF'\`." - if [[ -n ${EBUILD_OVERLAY_ECLASSES} ]] ; then - eerror "This ebuild used the following eclasses from overlays:" - local x - for x in ${EBUILD_OVERLAY_ECLASSES} ; do - eerror " ${x}" - done - fi if [ "${EMERGE_FROM}" != "binary" ] && \ ! has ${EBUILD_PHASE} prerm postrm && \ [ "${EBUILD#${PORTDIR}/}" == "${EBUILD}" ] ; then @@ -482,4 +475,20 @@ has() { return 1 } +__repo_key() { + local appropriate_section=0 exit_status=1 line saved_extglob_shopt=$(shopt -p extglob) + shopt -s extglob + while read line; do + [[ ${appropriate_section} == 0 && ${line} == "[$1]" ]] && appropriate_section=1 && continue + [[ ${appropriate_section} == 1 && ${line} == "["*"]" ]] && appropriate_section=0 && continue + if [[ ${appropriate_section} == 1 && ${line} == $2*( )=* ]]; then + echo "${line##$2*( )=*( )}" + exit_status=0 + break + fi + done <<< "${PORTAGE_REPOSITORIES}" + eval "${saved_extglob_shopt}" + return ${exit_status} +} + true diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index f67879ef2..dc4da6a4e 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -29,7 +29,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \ PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \ PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \ PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTAGE_XATTR_EXCLUDE \ - PORTDIR PORTDIR_OVERLAY \ + PORTDIR \ PROFILE_PATHS REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \ __PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS" diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py index 7ffe66b88..9db600ead 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -305,11 +305,11 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, if hasattr(mydbapi, 'repositories'): repo = mydbapi.repositories.get_repo_for_location(mytree) mysettings['PORTDIR'] = repo.eclass_db.porttrees[0] - mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:]) mysettings['PORTAGE_REPOSITORIES'] = mydbapi.repositories.config_string() mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"]) + mysettings.pop("PORTDIR_OVERLAY", None) mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"]) mysettings["RPMDIR"] = os.path.realpath(mysettings["RPMDIR"])