summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-11 16:15:28 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-11 16:15:28 -0700
commit11d543aacf2ee7f7f214a256aabf668ad27ca013 (patch)
treef2601ac341ec1072a270fce7c64bd0653c7029c3
parent8fb7653c2923bd1a1de5eb842356020c6fbf065e (diff)
downloadportage-11d543aacf2ee7f7f214a256aabf668ad27ca013.tar.gz
portage-11d543aacf2ee7f7f214a256aabf668ad27ca013.tar.bz2
portage-11d543aacf2ee7f7f214a256aabf668ad27ca013.zip
ebuild.sh: move hasg* funcs into econf
-rwxr-xr-xbin/ebuild.sh8
-rw-r--r--bin/isolated-functions.sh4
-rw-r--r--bin/phase-helpers.sh15
3 files changed, 14 insertions, 13 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 355a1c034..832b39dc9 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -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.
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 8e367fff1..c5adc0cc5 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -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
diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 1f39c7556..a033fa837 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -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}"