summaryrefslogtreecommitdiffstats
path: root/bin/ebuild.sh
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-09-26 22:31:20 +0200
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>2012-09-26 22:31:20 +0200
commitab46499322311c1faa710c63d0a5339e49a9061a (patch)
tree2461ce1b29a6c5631b66bdfa1e730394fddca617 /bin/ebuild.sh
parentc371cb4d1a1858c6271af9abee53b1dcc28d5435 (diff)
downloadportage-ab46499322311c1faa710c63d0a5339e49a9061a.tar.gz
portage-ab46499322311c1faa710c63d0a5339e49a9061a.tar.bz2
portage-ab46499322311c1faa710c63d0a5339e49a9061a.zip
Add eapi.sh with ___eapi_*() functions and use these functions in other files.
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-xbin/ebuild.sh32
1 files changed, 11 insertions, 21 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 06e2c66f6..aa3dcdd28 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -26,16 +26,16 @@ else
__strip_duplicate_slashes \
use_with use_enable ; do
eval "${x}() {
- if has \"\${EAPI:-0}\" 4-python 5-progress; then
+ if ___eapi_disallows_helpers_in_global_scope; then
die \"\${FUNCNAME}() calls are not allowed in global scope\"
fi
}"
done
- # These dummy functions return false in older EAPIs, in order to ensure that
+ # These dummy functions return false in non-strict EAPIs, in order to ensure that
# `use multislot` is false for the "depend" phase.
for x in use useq usev usex ; do
eval "${x}() {
- if has \"\${EAPI:-0}\" 4-python 5-progress; then
+ if ___eapi_disallows_helpers_in_global_scope; then
die \"\${FUNCNAME}() calls are not allowed in global scope\"
else
return 1
@@ -512,7 +512,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
[[ -n $EAPI ]] || EAPI=0
fi
-if has "${EAPI:-0}" 4-python 5-progress; then
+if ___eapi_enables_globstar; then
shopt -s globstar
fi
@@ -557,7 +557,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
# export EAPI for helpers (especially since we unset it above)
export EAPI
- if has "$EAPI" 0 1 2 3 ; then
+ if ___eapi_has_RDEPEND_DEPEND_fallback; then
export RDEPEND=${RDEPEND-${DEPEND}}
debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
fi
@@ -675,13 +675,9 @@ if [[ $EBUILD_PHASE = depend ]] ; then
PROPERTIES DEFINED_PHASES HDEPEND UNUSED_04
UNUSED_03 UNUSED_02 UNUSED_01"
- case ${EAPI} in
- 5-hdepend)
- ;;
- *)
- unset HDEPEND
- ;;
- esac
+ if ! ___eapi_has_HDEPEND; then
+ unset HDEPEND
+ fi
# The extra $(echo) commands remove newlines.
if [ -n "${dbkey}" ] ; then
@@ -700,15 +696,9 @@ else
# Note: readonly variables interfere with __preprocess_ebuild_env(), so
# declare them only after it has already run.
declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS
- case ${EAPI} in
- 0|1|2)
- [[ " ${FEATURES} " == *" force-prefix "* ]] && \
- declare -r ED EPREFIX EROOT
- ;;
- *)
- declare -r ED EPREFIX EROOT
- ;;
- esac
+ if ___eapi_has_prefix_variables; then
+ declare -r ED EPREFIX EROOT
+ fi
if [[ -n $EBUILD_SH_ARGS ]] ; then
(