From ab46499322311c1faa710c63d0a5339e49a9061a Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Wed, 26 Sep 2012 22:31:20 +0200 Subject: Add eapi.sh with ___eapi_*() functions and use these functions in other files. --- bin/ebuild.sh | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'bin/ebuild.sh') 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 ( -- cgit v1.2.3-1-g7c22