summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-05-02 22:34:09 +0000
committerZac Medico <zmedico@gentoo.org>2009-05-02 22:34:09 +0000
commita961ebe1e42fb98ca76c08ad1d8a8d5d6172e324 (patch)
tree02dc518390b027f4acd9941468f9561df0adc737
parent2341257996e5fd477b83a65ccbe79b0d4a5fcf8e (diff)
downloadportage-a961ebe1e42fb98ca76c08ad1d8a8d5d6172e324.tar.gz
portage-a961ebe1e42fb98ca76c08ad1d8a8d5d6172e324.tar.bz2
portage-a961ebe1e42fb98ca76c08ad1d8a8d5d6172e324.zip
Make useq() die if called during the "depend" phase in newer EAPIs.
svn path=/main/trunk/; revision=13598
-rwxr-xr-xbin/ebuild.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 9d49ae2a4..ca001ab33 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -141,12 +141,16 @@ useq() {
found=1
fi
+ if [[ $EBUILD_PHASE = depend ]] ; then
+ # Skip this for older EAPIs since lots of ebuilds/eclasses
+ # have stuff in global scope that really belongs somewhere
+ # like pkg_setup or src_configure.
+ if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 ; then
+ die "use() called during invalid phase: $EBUILD_PHASE"
+ fi
+
# Make sure we have this USE flag in IUSE
- # Skip this during the "depend" phase because lots of ebuilds/eclasses
- # have stuff in global scope that really belongs somewhere like pkg_setup
- # or src_configure.
- if [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE && \
- $EBUILD_PHASE != depend ]] ; then
+ elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
[[ $u =~ $PORTAGE_IUSE ]] || \
eqawarn "QA Notice: USE Flag '${u}' not" \
"in IUSE for ${CATEGORY}/${PF}"