| 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.
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
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.
#!/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"
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
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
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"
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"])