ebuild.sh: move hasg* funcs into econf
authorZac Medico <zmedico@gentoo.org>
Sun, 11 Sep 2011 23:15:28 +0000 (16:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 11 Sep 2011 23:15:28 +0000 (16:15 -0700)
bin/ebuild.sh
bin/isolated-functions.sh
bin/phase-helpers.sh

index 355a1c034401c49ea127ec9ae76f27dca8e3517b..832b39dc978a9f1738b1844f1f43f65a7345373b 100755 (executable)
@@ -166,14 +166,6 @@ strip_duplicate_slashes() {
        fi
 }
 
-hasg() {
-    local x s=$1
-    shift
-    for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
-    return 1
-}
-hasgq() { hasg "$@" >/dev/null ; }
-
 # debug-print() gets called from many places with verbose status information useful
 # for tracking down problems. The output is in $T/eclass-debug.log.
 # You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
index 8e367fff1030c74f42698189c5be43693f141f9a..c5adc0cc5ceb1e8e17d311e75e3c4b8333ca8061 100644 (file)
@@ -586,7 +586,7 @@ save_ebuild_env() {
                        esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
                        KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
                        has_phase_defined_up_to \
-                       hasg hasgq hasv hasq qa_source qa_call \
+                       hasv hasq qa_source qa_call \
                        addread addwrite adddeny addpredict _sb_append_var \
                        use usev useq has_version portageq \
                        best_version use_with use_enable register_die_hook \
@@ -602,7 +602,7 @@ save_ebuild_env() {
                        set_unless_changed unset_unless_changed source_all_bashrcs \
                        ebuild_main ebuild_phase ebuild_phase_with_hooks \
                        _ebuild_arg_to_phase _ebuild_phase_funcs default \
-                       _pipestatus \
+                       _hasg _hasgq _unpack_tar \
                        ${QA_INTERCEPTORS}
 
                # portage config variables and variables set directly by portage
index 1f39c75564431d00a1f334c043280836dc9ad3fb..a033fa8374186ee19fde288975e1528155197557 100644 (file)
@@ -369,6 +369,15 @@ unpack() {
 econf() {
        local x
 
+       _hasg() {
+               local x s=$1
+               shift
+               for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
+               return 1
+       }
+
+       _hasgq() { _hasg "$@" >/dev/null ; }
+
        local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
        if [[ -n $phase_func ]] ; then
                if has "$EAPI" 0 1 ; then
@@ -411,9 +420,9 @@ econf() {
                if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
                        CONF_LIBDIR=${!LIBDIR_VAR}
                fi
-               if [[ -n ${CONF_LIBDIR} ]] && ! hasgq --libdir=\* "$@" ; then
-                       export CONF_PREFIX=$(hasg --exec-prefix=\* "$@")
-                       [[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(hasg --prefix=\* "$@")
+               if [[ -n ${CONF_LIBDIR} ]] && ! _hasgq --libdir=\* "$@" ; then
+                       export CONF_PREFIX=$(_hasg --exec-prefix=\* "$@")
+                       [[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(_hasg --prefix=\* "$@")
                        : ${CONF_PREFIX:=/usr}
                        CONF_PREFIX=${CONF_PREFIX#*=}
                        [[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"