summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-02 10:56:51 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-02 10:56:51 -0700
commite5977579376dd124bb341263f73a5d302dbc0863 (patch)
treec16e17e80f86ac36302d5cc92afc58886f4b83f0 /bin
parent64cb7424256c47b1740a86580f41c0c535e036a3 (diff)
downloadportage-e5977579376dd124bb341263f73a5d302dbc0863.tar.gz
portage-e5977579376dd124bb341263f73a5d302dbc0863.tar.bz2
portage-e5977579376dd124bb341263f73a5d302dbc0863.zip
ebuild.sh: make INHERITED independent of phase
When EBUILD_PHASE != depend, INHERITED comes pre-initialized from cache. In order to make INHERITED content independent of EBUILD_PHASE during inherit() calls, we unset INHERITED after we make a backup copy for QA checks.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 6593755cd..b6103424f 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1359,7 +1359,7 @@ inherit() {
# This is disabled in the *rm phases because they frequently give
# false alarms due to INHERITED in /var/db/pkg being outdated
# in comparison the the eclasses from the portage tree.
- if ! hasq $ECLASS $INHERITED; then
+ if ! hasq $ECLASS $INHERITED $__INHERITED_QA_CACHE ; then
eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF $EBUILD_PHASE"
fi
fi
@@ -2023,11 +2023,18 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
# during sourcing of ebuilds and eclasses.
source_all_bashrcs
+ # When EBUILD_PHASE != depend, INHERITED comes pre-initialized
+ # from cache. In order to make INHERITED content independent of
+ # EBUILD_PHASE during inherit() calls, we unset INHERITED after
+ # we make a backup copy for QA checks.
+ __INHERITED_QA_CACHE=$INHERITED
+
# *DEPEND and IUSE will be set during the sourcing of the ebuild.
# In order to ensure correct interaction between ebuilds and
# eclasses, they need to be unset before this process of
# interaction begins.
- unset DEPEND RDEPEND PDEPEND IUSE REQUIRED_USE
+ unset DEPEND RDEPEND PDEPEND INHERITED IUSE REQUIRED_USE \
+ ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
source "$EBUILD" || die "error sourcing ebuild"
@@ -2057,7 +2064,8 @@ if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
PDEPEND="${PDEPEND} ${E_PDEPEND}"
REQUIRED_USE="${REQUIRED_USE} ${E_REQUIRED_USE}"
- unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
+ unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND \
+ __INHERITED_QA_CACHE
# alphabetically ordered by $EBUILD_PHASE value
case "$EAPI" in