summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-12-19 02:33:27 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>2011-12-19 02:33:27 +0100
commit2ea565e1af3416ab5743c4b7181476d9a6734123 (patch)
tree32d094209e19f00cd84ed2cfaaa73a560930fcc3
parent7a0a0a1dc02487b08f47fef129a29e18f7c226a0 (diff)
downloadportage-2ea565e1af3416ab5743c4b7181476d9a6734123.tar.gz
portage-2ea565e1af3416ab5743c4b7181476d9a6734123.tar.bz2
portage-2ea565e1af3416ab5743c4b7181476d9a6734123.zip
Disallow some functions in global scope in EAPI="4-python".
-rwxr-xr-xbin/ebuild.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index af7b3a92b..63c246a89 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -25,17 +25,27 @@ else
libopts register_die_hook register_success_hook \
remove_path_entry set_unless_changed strip_duplicate_slashes \
unset_unless_changed use_with use_enable ; do
- eval "${x}() { : ; }"
+ eval "${x}() {
+ if has \"\${EAPI:-0}\" 4-python; then
+ die \"\${FUNCNAME}() calls are not allowed in global scope\"
+ fi
+ }"
done
- # These dummy functions return false, in order to ensure that
+ # These dummy functions return false in older EAPIs, in order to ensure that
# `use multislot` is false for the "depend" phase.
for x in use useq usev ; do
- eval "${x}() { return 1; }"
+ eval "${x}() {
+ if has \"\${EAPI:-0}\" 4-python; then
+ die \"\${FUNCNAME}() calls are not allowed in global scope\"
+ else
+ return 1
+ fi
+ }"
done
# These functions die because calls to them during the "depend" phase
# are considered to be severe QA violations.
for x in best_version has_version portageq ; do
- eval "${x}() { die \"\${FUNCNAME} calls are not allowed in global scope\"; }"
+ eval "${x}() { die \"\${FUNCNAME}() calls are not allowed in global scope\"; }"
done
unset x
fi