Convert funcs of bashrc-functions.sh to __ prefixed namespace.
authorBrian Harring <ferringb@gmail.com>
Fri, 14 Sep 2012 04:41:04 +0000 (21:41 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 06:55:44 +0000 (23:55 -0700)
bin/bashrc-functions.sh
bin/ebuild-helpers/ecompressdir
bin/ebuild-helpers/prepstrip
bin/ebuild.sh
bin/helper-functions.sh
bin/phase-helpers.sh
bin/save-ebuild-env.sh

index 9fdf999fef0df6476c8cfa383176d1000dbb92c6..30a7a8e1e03e0d660c1a21dea0678bb114cc3aba 100644 (file)
@@ -23,7 +23,7 @@ register_success_hook() {
        done
 }
 
-strip_duplicate_slashes() {
+__strip_duplicate_slashes() {
        if [[ -n $1 ]] ; then
                local removed=$1
                while [[ ${removed} == *//* ]] ; do
index 6801a07d4b9d834d144a809769dd378f96c36c9d..5ca0d3a358fa859e18da8794d23ffeff22c0098b 100755 (executable)
@@ -133,7 +133,7 @@ decompressors=(
        ".lzma" "unxz -f"
 )
 
-multijob_init
+__multijob_init
 
 for dir in "$@" ; do
        dir=${dir#/}
@@ -161,14 +161,14 @@ for dir in "$@" ; do
                # ends up launching less compressors overall, so the overhead
                # of forking children ends up dominating.
                (
-               multijob_child_init
+               __multijob_child_init
                funk_up_dir "decompress" "${decompressors[i]}" "${decompressors[i+1]}"
                ) &
-               multijob_post_fork
+               __multijob_post_fork
                : $(( ret |= $? ))
        done
 
-       multijob_finish
+       __multijob_finish
        : $(( ret |= $? ))
 
        # forcibly break all hard links as some compressors whine about it
index 5f87482cdeb805b5cbdb9f103e65c95b1ba49592..2556ee240cfe6714552daaebc67d357c6fe5b0ed 100755 (executable)
@@ -62,7 +62,7 @@ prepstrip_sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}
 type -P debugedit >/dev/null && debugedit_found=true || debugedit_found=false
 debugedit_warned=false
 
-multijob_init
+__multijob_init
 
 # Setup $T filesystem layout that we care about.
 tmpdir="${T}/prepstrip"
@@ -206,7 +206,7 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
        log=${tmpdir}/scanelf-already-stripped.log
        scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "${log}"
        (
-       multijob_child_init
+       __multijob_child_init
        qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
        [[ -n ${!qa_var} ]] && QA_PRESTRIPPED="${!qa_var}"
        if [[ -n ${QA_PRESTRIPPED} && -s ${log} && \
@@ -228,7 +228,7 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
                rm -f "${log}"
        fi
        ) &
-       multijob_post_fork
+       __multijob_post_fork
 fi
 
 # Now we look for unstripped binaries.
@@ -242,7 +242,7 @@ do
        fi
 
        (
-       multijob_child_init
+       __multijob_child_init
        f=$(file "${x}") || exit 0
        [[ -z ${f} ]] && exit 0
 
@@ -292,12 +292,12 @@ do
                chmod u-w "${x}"
        fi
        ) &
-       multijob_post_fork
+       __multijob_post_fork
 done
 
 # With a bit more work, we could run the rsync processes below in
 # parallel, but not sure that'd be an overall improvement.
-multijob_finish
+__multijob_finish
 
 cd "${tmpdir}"/sources/ && cat * > "${tmpdir}/debug.sources" 2>/dev/null
 if [[ -s ${tmpdir}/debug.sources ]] && \
index 5178a37538473150a88f46ebc8a99d17fb0f530f..c6f267669d41bcd1a260b2023e659f808126ebf5 100755 (executable)
@@ -23,7 +23,7 @@ else
        for x in diropts docompress exeopts get_KV insopts \
                keepdir KV_major KV_micro KV_minor KV_to_int \
                libopts register_die_hook register_success_hook \
-               strip_duplicate_slashes \
+               __strip_duplicate_slashes \
                use_with use_enable ; do
                eval "${x}() {
                        if has \"\${EAPI:-0}\" 4-python; then
index c7400fa4b2cc8ddc3885c81e1c23662b7153d01b..65f41f6d035ad38c1d38791e494132eb1b39881b 100644 (file)
@@ -10,42 +10,42 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
 #
 # API functions for doing parallel processing
 #
-numjobs() {
+__numjobs() {
        # Copied from eutils.eclass:makeopts_jobs()
        local jobs=$(echo " ${MAKEOPTS} " | \
                sed -r -n 's:.*[[:space:]](-j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p')
        echo ${jobs:-1}
 }
 
-multijob_init() {
+__multijob_init() {
        # Setup a pipe for children to write their pids to when they finish.
        mj_control_pipe=$(mktemp -t multijob.XXXXXX)
        rm "${mj_control_pipe}"
        mkfifo "${mj_control_pipe}"
-       redirect_alloc_fd mj_control_fd "${mj_control_pipe}"
+       __redirect_alloc_fd mj_control_fd "${mj_control_pipe}"
        rm -f "${mj_control_pipe}"
 
        # See how many children we can fork based on the user's settings.
-       mj_max_jobs=$(numjobs)
+       mj_max_jobs=$(__numjobs)
        mj_num_jobs=0
 }
 
-multijob_child_init() {
+__multijob_child_init() {
        trap 'echo ${BASHPID} $? >&'${mj_control_fd} EXIT
        trap 'exit 1' INT TERM
 }
 
-multijob_finish_one() {
+__multijob_finish_one() {
        local pid ret
        read -r -u ${mj_control_fd} pid ret
        : $(( --mj_num_jobs ))
        return ${ret}
 }
 
-multijob_finish() {
+__multijob_finish() {
        local ret=0
        while [[ ${mj_num_jobs} -gt 0 ]] ; do
-               multijob_finish_one
+               __multijob_finish_one
                : $(( ret |= $? ))
        done
        # Let bash clean up its internal child tracking state.
@@ -53,21 +53,21 @@ multijob_finish() {
        return ${ret}
 }
 
-multijob_post_fork() {
+__multijob_post_fork() {
        : $(( ++mj_num_jobs ))
        if [[ ${mj_num_jobs} -ge ${mj_max_jobs} ]] ; then
-               multijob_finish_one
+               __multijob_finish_one
        fi
        return $?
 }
 
-# @FUNCTION: redirect_alloc_fd
+# @FUNCTION: __redirect_alloc_fd
 # @USAGE: <var> <file> [redirection]
 # @DESCRIPTION:
 # Find a free fd and redirect the specified file via it.  Store the new
 # fd in the specified variable.  Useful for the cases where we don't care
 # about the exact fd #.
-redirect_alloc_fd() {
+__redirect_alloc_fd() {
        local var=$1 file=$2 redir=${3:-"<>"}
 
        if [[ $(( (BASH_VERSINFO[0] << 8) + BASH_VERSINFO[1] )) -ge $(( (4 << 8) + 1 )) ]] ; then
@@ -82,7 +82,7 @@ redirect_alloc_fd() {
                                        if [[ ! -e /dev/fd/${fd} ]] && [[ ! -L /dev/fd/${fd} ]] ; then
                                                        eval "exec ${fd}${redir}'${file}'" && break
                                        fi
-                                       [[ ${fd} -gt 1024 ]] && die "redirect_alloc_fd failed"
+                                       [[ ${fd} -gt 1024 ]] && die "__redirect_alloc_fd failed"
                                        : $(( ++fd ))
                        done
                        : $(( ${var} = fd ))
index 555b2372bf4d6e2e0ba20e04b2a67c176c51fa25..106e260178edd5e3399e98c7d5e8545d26b1d370 100644 (file)
@@ -118,7 +118,7 @@ docompress() {
        if [[ $1 = "-x" ]]; then
                shift
                for f; do
-                       f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+                       f=$(__strip_duplicate_slashes "${f}"); f=${f%/}
                        [[ ${f:0:1} = / ]] || f="/${f}"
                        for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
                                [[ ${f} = "${g}" ]] && continue 2
@@ -127,7 +127,7 @@ docompress() {
                done
        else
                for f; do
-                       f=$(strip_duplicate_slashes "${f}"); f=${f%/}
+                       f=$(__strip_duplicate_slashes "${f}"); f=${f%/}
                        [[ ${f:0:1} = / ]] || f="/${f}"
                        for g in "${PORTAGE_DOCOMPRESS[@]}"; do
                                [[ ${f} = "${g}" ]] && continue 2
@@ -476,7 +476,7 @@ econf() {
                        CONF_PREFIX=${CONF_PREFIX#*=}
                        [[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
                        [[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
-                       set -- --libdir="$(strip_duplicate_slashes ${CONF_PREFIX}${CONF_LIBDIR})" "$@"
+                       set -- --libdir="$(__strip_duplicate_slashes ${CONF_PREFIX}${CONF_LIBDIR})" "$@"
                fi
 
                set -- \
@@ -521,7 +521,7 @@ einstall() {
        unset LIBDIR_VAR
        if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
                EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
-               EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})"
+               EI_DESTLIBDIR="$(__strip_duplicate_slashes ${EI_DESTLIBDIR})"
                LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
                unset EI_DESTLIBDIR
        fi
index 6b38e5d9a0f699ae812a6ef36b86f7d90d9b0afd..c09ce5b590a0a65a372ecef00931f889109d0540 100644 (file)
@@ -56,7 +56,7 @@ save_ebuild_env() {
                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 \
+               keepdir unpack __strip_duplicate_slashes econf einstall \
                dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
                insopts diropts exeopts libopts docompress \
                abort_handler abort_prepare abort_configure abort_compile \