aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Harring <ferringb@gmail.com>2012-09-13 23:29:44 -0700
committerZac Medico <zmedico@gentoo.org>2012-09-14 00:14:21 -0700
commit5a3fb946698ec789e724158ec5742cdc49ac7473 (patch)
treeb743666482ef77988b305f43c550b8fcdcadb4be
parentConvert funcs of save-ebuild-env.sh to __ prefixed namespace. (diff)
downloadportage-5a3fb946698ec789e724158ec5742cdc49ac7473.tar.gz
portage-5a3fb946698ec789e724158ec5742cdc49ac7473.tar.bz2
portage-5a3fb946698ec789e724158ec5742cdc49ac7473.zip
Convert funcs of ebuild.sh to __ prefixed namespace.
-rwxr-xr-xbin/ebuild.sh26
-rw-r--r--bin/isolated-functions.sh8
-rwxr-xr-xbin/misc-functions.sh2
-rw-r--r--bin/phase-functions.sh4
-rw-r--r--bin/save-ebuild-env.sh6
5 files changed, 23 insertions, 23 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 2f68b2e94..a6ff45301 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -66,7 +66,7 @@ export PORTAGE_BZIP2_COMMAND=${PORTAGE_BZIP2_COMMAND:-bzip2}
# with shell opts (shopts). Ebuilds/eclasses changing shopts should reset them
# when they are done.
-qa_source() {
+__qa_source() {
local shopts=$(shopt) OLDIFS="$IFS"
local retval
source "$@"
@@ -79,7 +79,7 @@ qa_source() {
return $retval
}
-qa_call() {
+__qa_call() {
local shopts=$(shopt) OLDIFS="$IFS"
local retval
"$@"
@@ -102,7 +102,7 @@ unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOBIGNORE
[[ $PORTAGE_QUIET != "" ]] && export PORTAGE_QUIET
# sandbox support functions; defined prior to profile.bashrc srcing, since the profile might need to add a default exception (/usr/lib64/conftest fex)
-_sb_append_var() {
+__sb_append_var() {
local _v=$1 ; shift
local var="SANDBOX_${_v}"
[[ -z $1 || -n $2 ]] && die "Usage: add$(echo ${_v} | \
@@ -111,11 +111,11 @@ _sb_append_var() {
}
# bash-4 version:
# local var="SANDBOX_${1^^}"
-# addread() { _sb_append_var ${0#add} "$@" ; }
-addread() { _sb_append_var READ "$@" ; }
-addwrite() { _sb_append_var WRITE "$@" ; }
-adddeny() { _sb_append_var DENY "$@" ; }
-addpredict() { _sb_append_var PREDICT "$@" ; }
+# addread() { __sb_append_var ${0#add} "$@" ; }
+addread() { __sb_append_var READ "$@" ; }
+addwrite() { __sb_append_var WRITE "$@" ; }
+adddeny() { __sb_append_var DENY "$@" ; }
+addpredict() { __sb_append_var PREDICT "$@" ; }
addwrite "${PORTAGE_TMPDIR}"
addread "/:${PORTAGE_TMPDIR}"
@@ -274,7 +274,7 @@ inherit() {
#turn on glob expansion
set +f
- qa_source "$location" || die "died sourcing $location in inherit()"
+ __qa_source "$location" || die "died sourcing $location in inherit()"
#turn off glob expansion
set -f
@@ -342,7 +342,7 @@ EXPORT_FUNCTIONS() {
PORTAGE_BASHRCS_SOURCED=0
-# @FUNCTION: source_all_bashrcs
+# @FUNCTION: __source_all_bashrcs
# @DESCRIPTION:
# Source a relevant bashrc files and perform other miscellaneous
# environment initialization when appropriate.
@@ -353,7 +353,7 @@ PORTAGE_BASHRCS_SOURCED=0
# * A "default" function which is an alias for the default phase
# function for the current phase.
#
-source_all_bashrcs() {
+__source_all_bashrcs() {
[[ $PORTAGE_BASHRCS_SOURCED = 1 ]] && return 0
PORTAGE_BASHRCS_SOURCED=1
local x
@@ -367,7 +367,7 @@ source_all_bashrcs() {
local path_array=($PROFILE_PATHS)
restore_IFS
for x in "${path_array[@]}" ; do
- [ -f "$x/profile.bashrc" ] && qa_source "$x/profile.bashrc"
+ [ -f "$x/profile.bashrc" ] && __qa_source "$x/profile.bashrc"
done
fi
@@ -516,7 +516,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
has noauto $FEATURES ; then
# The bashrcs get an opportunity here to set aliases that will be expanded
# during sourcing of ebuilds and eclasses.
- source_all_bashrcs
+ __source_all_bashrcs
# When EBUILD_PHASE != depend, INHERITED comes pre-initialized
# from cache. In order to make INHERITED content independent of
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 076e31f43..fa84c7ee3 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -51,13 +51,13 @@ __dump_trace() {
declare -i strip=${1:-1}
local filespacing=$2 linespacing=$3
- # The qa_call() function and anything before it are portage internals
+ # The __qa_call() function and anything before it are portage internals
# that the user will not be interested in. Therefore, the stack trace
- # should only show calls that come after qa_call().
+ # should only show calls that come after __qa_call().
(( n = ${#FUNCNAME[@]} - 1 ))
(( p = ${#BASH_ARGV[@]} ))
while (( n > 0 )) ; do
- [ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+ [ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
(( p -= ${BASH_ARGC[${n}]} ))
(( n-- ))
done
@@ -124,7 +124,7 @@ die() {
# setup spacing to make output easier to read
(( n = ${#FUNCNAME[@]} - 1 ))
while (( n > 0 )) ; do
- [ "${FUNCNAME[${n}]}" == "qa_call" ] && break
+ [ "${FUNCNAME[${n}]}" == "__qa_call" ] && break
(( n-- ))
done
(( n == 0 )) && (( n = ${#FUNCNAME[@]} - 1 ))
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index fe38e23b8..486b8d29a 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1254,7 +1254,7 @@ install_hooks() {
}
if [ -n "${MISC_FUNCTIONS_ARGS}" ]; then
- source_all_bashrcs
+ __source_all_bashrcs
[ "$PORTAGE_DEBUG" == "1" ] && set -x
for x in ${MISC_FUNCTIONS_ARGS}; do
${x}
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 71f4787e9..7048419ff 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -198,7 +198,7 @@ __preprocess_ebuild_env() {
}
__ebuild_phase() {
- declare -F "$1" >/dev/null && qa_call $1
+ declare -F "$1" >/dev/null && __qa_call $1
}
__ebuild_phase_with_hooks() {
@@ -865,7 +865,7 @@ __ebuild_main() {
[[ -n $phase_func ]] && __ebuild_phase_funcs "$EAPI" "$phase_func"
unset phase_func
- source_all_bashrcs
+ __source_all_bashrcs
case ${1} in
nofetch)
diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh
index 8db3ecbce..c2082aba3 100644
--- a/bin/save-ebuild-env.sh
+++ b/bin/save-ebuild-env.sh
@@ -52,8 +52,8 @@ __save_ebuild_env() {
einfo einfon ewarn eerror ebegin __eend eend KV_major \
KV_minor KV_micro KV_to_int get_KV __1 __1 has \
__has_phase_defined_up_to \
- hasv hasq qa_source qa_call \
- addread addwrite adddeny addpredict _sb_append_var \
+ 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 \
keepdir unpack __strip_duplicate_slashes econf einstall \
@@ -67,7 +67,7 @@ __save_ebuild_env() {
debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
nonfatal register_success_hook \
__save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
- source_all_bashrcs \
+ __source_all_bashrcs \
__ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
__ebuild_arg_to_phase __ebuild_phase_funcs default \
_hasg _hasgq _unpack_tar \