summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-03-08 06:53:55 +0000
committerZac Medico <zmedico@gentoo.org>2009-03-08 06:53:55 +0000
commit0ce8797d6b342d20dc2ec4661551c1e338603e4c (patch)
treef0839ae124740be7318f925e59a30bee18c55a0b
parent63afbc1009c87071a6a66bf3f6dd26c311a81fe8 (diff)
downloadportage-0ce8797d6b342d20dc2ec4661551c1e338603e4c.tar.gz
portage-0ce8797d6b342d20dc2ec4661551c1e338603e4c.tar.bz2
portage-0ce8797d6b342d20dc2ec4661551c1e338603e4c.zip
Fix PECLASS logic inside inherit() so that ECLASS is always restored to the
correct value after recursion (previously it would be restored to the wrong value if more than one eclass was passed into the inherit call). svn path=/main/trunk/; revision=12783
-rwxr-xr-xbin/ebuild.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index d1ff26aba..ff61f07d4 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1158,7 +1158,7 @@ inherit() {
local location
local olocation
- local PECLASS
+ local PECLASS=$ECLASS
local export_funcs_var x
local B_IUSE
@@ -1169,8 +1169,6 @@ inherit() {
location="${ECLASSDIR}/${1}.eclass"
olocation=""
- # PECLASS is used to restore the ECLASS var after recursion.
- PECLASS="$ECLASS"
export ECLASS="$1"
export_funcs_var=__export_functions_${ECLASS/-/___}
unset $export_funcs_var
@@ -1258,11 +1256,15 @@ inherit() {
hasq $1 $INHERITED || export INHERITED="$INHERITED $1"
- export ECLASS="$PECLASS"
-
shift
done
((--ECLASS_DEPTH)) # Returns 1 when ECLASS_DEPTH reaches 0.
+ if (( ECLASS_DEPTH > 1 )) ; then
+ # PECLASS is used to restore the ECLASS var after recursion.
+ export ECLASS=$PECLASS
+ else
+ unset ECLASS
+ fi
return 0
}