Convert funcs of phase*.sh to __ prefixed namespace.
authorBrian Harring <ferringb@gmail.com>
Fri, 14 Sep 2012 06:00:10 +0000 (23:00 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 07:13:31 +0000 (00:13 -0700)
bin/ebuild.sh
bin/misc-functions.sh
bin/phase-functions.sh
bin/phase-helpers.sh
bin/save-ebuild-env.sh
pym/portage/package/ebuild/doebuild.py

index c6f267669d41bcd1a260b2023e659f808126ebf5..2f68b2e94ef8926eacd4bc8840143d95f000dede 100755 (executable)
@@ -473,7 +473,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm depend && \
        # may have come from another version of ebuild.sh or something.
        # In any case, preprocess it to prevent any potential interference.
        # NOTE: export ${FOO}=... requires quoting, unlike normal exports
-       preprocess_ebuild_env || \
+       __preprocess_ebuild_env || \
                die "error processing environment"
        # Colon separated SANDBOX_* variables need to be cumulative.
        for x in SANDBOX_DENY SANDBOX_READ SANDBOX_PREDICT SANDBOX_WRITE ; do
@@ -681,7 +681,7 @@ if [[ $EBUILD_PHASE = depend ]] ; then
        fi
        set +f
 else
-       # Note: readonly variables interfere with preprocess_ebuild_env(), so
+       # 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
@@ -699,7 +699,7 @@ else
                        # Don't allow subprocesses to inherit the pipe which
                        # emerge uses to monitor ebuild.sh.
                        exec 9>&-
-                       ebuild_main ${EBUILD_SH_ARGS}
+                       __ebuild_main ${EBUILD_SH_ARGS}
                        exit 0
                )
                exit $?
index 5bc946fc19b8260f7a8e59e80480a3d007f77cfb..fe38e23b80557a0715a9af0375182b480d2ad003 100755 (executable)
@@ -1082,7 +1082,7 @@ preinst_selinux_labels() {
                 return 1
        fi
        if has selinux ${FEATURES}; then
-               # SELinux file labeling (needs to always be last in dyn_preinst)
+               # SELinux file labeling (needs to always be last in __dyn_preinst)
                # only attempt to label if setfiles is executable
                # and 'context' is available on selinuxfs.
                if [ -f /selinux/context -o -f /sys/fs/selinux/context ] && \
@@ -1105,7 +1105,7 @@ preinst_selinux_labels() {
        fi
 }
 
-dyn_package() {
+__dyn_package() {
        local PROOT
 
        [[ " ${FEATURES} " == *" force-prefix "* ]] || \
@@ -1167,7 +1167,7 @@ dyn_package() {
                die "Failed to create $PORTAGE_BUILDDIR/.packaged"
 }
 
-dyn_spec() {
+__dyn_spec() {
        local sources_dir=/usr/src/rpm/SOURCES
        mkdir -p "${sources_dir}"
        declare -a tar_args=("${EBUILD}")
@@ -1205,7 +1205,7 @@ __END1__
 
 }
 
-dyn_rpm() {
+__dyn_rpm() {
 
        [[ " ${FEATURES} " == *" force-prefix "* ]] || \
                case "$EAPI" in 0|1|2) local EPREFIX= ;; esac
@@ -1215,7 +1215,7 @@ dyn_rpm() {
        local dest_dir=${EPREFIX}/usr/src/rpm/RPMS/${machine_name}
        addwrite ${EPREFIX}/usr/src/rpm
        addwrite "${RPMDIR}"
-       dyn_spec
+       __dyn_spec
        rpmbuild -bb --clean --rmsource "${PF}.spec" || die "Failed to integrate rpm spec file"
        install -D "${dest_dir}/${PN}-${PV}-${PR}.${machine_name}.rpm" \
                "${RPMDIR}/${CATEGORY}/${PN}-${PV}-${PR}.rpm" || \
index 34e9da12dad71aca5440a83c04b470fcf92c3c49..8585a7193904170402e3d622b4247b745ae17131 100644 (file)
@@ -39,7 +39,7 @@ PORTAGE_SAVED_READONLY_VARS="A CATEGORY P PF PN PR PV PVR"
 # it is saved or loaded (any mutations do not persist).
 PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
 
-# @FUNCTION: filter_readonly_variables
+# @FUNCTION: __filter_readonly_variables
 # @DESCRIPTION: [--filter-sandbox] [--allow-extra-vars]
 # Read an environment from stdin and echo to stdout while filtering variables
 # with names that are known to cause interference:
@@ -81,7 +81,7 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
 # readonly variable cause the shell to exit while executing the "source"
 # builtin command. To avoid this problem, this function filters those
 # variables out and discards them. See bug #190128.
-filter_readonly_variables() {
+__filter_readonly_variables() {
        local x filtered_vars
        local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
                FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
@@ -140,14 +140,14 @@ filter_readonly_variables() {
        "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}"/filter-bash-environment.py "${filtered_vars}" || die "filter-bash-environment.py failed"
 }
 
-# @FUNCTION: preprocess_ebuild_env
+# @FUNCTION: __preprocess_ebuild_env
 # @DESCRIPTION:
 # Filter any readonly variables from ${T}/environment, source it, and then
 # save it via save_ebuild_env(). This process should be sufficient to prevent
 # any stale variables or functions from an arbitrary environment from
 # interfering with the current environment. This is useful when an existing
 # environment needs to be loaded from a binary or installed package.
-preprocess_ebuild_env() {
+__preprocess_ebuild_env() {
        local _portage_filter_opts="--filter-features --filter-locale --filter-path --filter-sandbox"
 
        # If environment.raw is present, this is a signal from the python side,
@@ -156,7 +156,7 @@ preprocess_ebuild_env() {
        # Otherwise, we don't need to filter the environment.
        [ -f "${T}/environment.raw" ] || return 0
 
-       filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
+       __filter_readonly_variables $_portage_filter_opts < "${T}"/environment \
                >> "$T/environment.filtered" || return $?
        unset _portage_filter_opts
        mv "${T}"/environment.filtered "${T}"/environment || return $?
@@ -187,7 +187,7 @@ preprocess_ebuild_env() {
        ) > "${T}/environment.filtered"
        local retval
        if [ -e "${T}/environment.success" ] ; then
-               filter_readonly_variables --filter-features < \
+               __filter_readonly_variables --filter-features < \
                        "${T}/environment.filtered" > "${T}/environment"
                retval=$?
        else
@@ -197,44 +197,44 @@ preprocess_ebuild_env() {
        return ${retval}
 }
 
-ebuild_phase() {
+__ebuild_phase() {
        declare -F "$1" >/dev/null && qa_call $1
 }
 
-ebuild_phase_with_hooks() {
+__ebuild_phase_with_hooks() {
        local x phase_name=${1}
        for x in {pre_,,post_}${phase_name} ; do
-               ebuild_phase ${x}
+               __ebuild_phase ${x}
        done
 }
 
-dyn_pretend() {
+__dyn_pretend() {
        if [[ -e $PORTAGE_BUILDDIR/.pretended ]] ; then
                __vecho ">>> It appears that '$PF' is already pretended; skipping."
                __vecho ">>> Remove '$PORTAGE_BUILDDIR/.pretended' to force pretend."
                return 0
        fi
-       ebuild_phase pre_pkg_pretend
-       ebuild_phase pkg_pretend
+       __ebuild_phase pre_pkg_pretend
+       __ebuild_phase pkg_pretend
        >> "$PORTAGE_BUILDDIR/.pretended" || \
                die "Failed to create $PORTAGE_BUILDDIR/.pretended"
-       ebuild_phase post_pkg_pretend
+       __ebuild_phase post_pkg_pretend
 }
 
-dyn_setup() {
+__dyn_setup() {
        if [[ -e $PORTAGE_BUILDDIR/.setuped ]] ; then
                __vecho ">>> It appears that '$PF' is already setup; skipping."
                __vecho ">>> Remove '$PORTAGE_BUILDDIR/.setuped' to force setup."
                return 0
        fi
-       ebuild_phase pre_pkg_setup
-       ebuild_phase pkg_setup
+       __ebuild_phase pre_pkg_setup
+       __ebuild_phase pkg_setup
        >> "$PORTAGE_BUILDDIR/.setuped" || \
                die "Failed to create $PORTAGE_BUILDDIR/.setuped"
-       ebuild_phase post_pkg_setup
+       __ebuild_phase post_pkg_setup
 }
 
-dyn_unpack() {
+__dyn_unpack() {
        if [[ -f ${PORTAGE_BUILDDIR}/.unpacked ]] ; then
                __vecho ">>> WORKDIR is up-to-date, keeping..."
                return 0
@@ -243,16 +243,16 @@ dyn_unpack() {
                install -m${PORTAGE_WORKDIR_MODE:-0700} -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
        fi
        cd "${WORKDIR}" || die "Directory change failed: \`cd '${WORKDIR}'\`"
-       ebuild_phase pre_src_unpack
+       __ebuild_phase pre_src_unpack
        __vecho ">>> Unpacking source..."
-       ebuild_phase src_unpack
+       __ebuild_phase src_unpack
        >> "$PORTAGE_BUILDDIR/.unpacked" || \
                die "Failed to create $PORTAGE_BUILDDIR/.unpacked"
        __vecho ">>> Source unpacked in ${WORKDIR}"
-       ebuild_phase post_src_unpack
+       __ebuild_phase post_src_unpack
 }
 
-dyn_clean() {
+__dyn_clean() {
        if [ -z "${PORTAGE_BUILDDIR}" ]; then
                echo "Aborting clean phase because PORTAGE_BUILDDIR is unset!"
                return 1
@@ -299,7 +299,7 @@ dyn_clean() {
        true
 }
 
-abort_handler() {
+__abort_handler() {
        local msg
        if [ "$2" != "fail" ]; then
                msg="${EBUILD}: ${1} aborted; exiting."
@@ -314,37 +314,37 @@ abort_handler() {
        trap - SIGINT SIGQUIT
 }
 
-abort_prepare() {
-       abort_handler src_prepare $1
+__abort_prepare() {
+       __abort_handler src_prepare $1
        rm -f "$PORTAGE_BUILDDIR/.prepared"
        exit 1
 }
 
-abort_configure() {
-       abort_handler src_configure $1
+__abort_configure() {
+       __abort_handler src_configure $1
        rm -f "$PORTAGE_BUILDDIR/.configured"
        exit 1
 }
 
-abort_compile() {
-       abort_handler "src_compile" $1
+__abort_compile() {
+       __abort_handler "src_compile" $1
        rm -f "${PORTAGE_BUILDDIR}/.compiled"
        exit 1
 }
 
-abort_test() {
-       abort_handler "dyn_test" $1
+__abort_test() {
+       __abort_handler "__dyn_test" $1
        rm -f "${PORTAGE_BUILDDIR}/.tested"
        exit 1
 }
 
-abort_install() {
-       abort_handler "src_install" $1
+__abort_install() {
+       __abort_handler "src_install" $1
        rm -rf "${PORTAGE_BUILDDIR}/image"
        exit 1
 }
 
-has_phase_defined_up_to() {
+__has_phase_defined_up_to() {
        local phase
        for phase in unpack prepare configure compile install; do
                has ${phase} ${DEFINED_PHASES} && return 0
@@ -354,7 +354,7 @@ has_phase_defined_up_to() {
        return 1
 }
 
-dyn_prepare() {
+__dyn_prepare() {
 
        if [[ -e $PORTAGE_BUILDDIR/.prepared ]] ; then
                __vecho ">>> It appears that '$PF' is already prepared; skipping."
@@ -366,26 +366,26 @@ dyn_prepare() {
                cd "${S}"
        elif has $EAPI 0 1 2 3 ; then
                cd "${WORKDIR}"
-       elif [[ -z ${A} ]] && ! has_phase_defined_up_to prepare; then
+       elif [[ -z ${A} ]] && ! __has_phase_defined_up_to prepare; then
                cd "${WORKDIR}"
        else
                die "The source directory '${S}' doesn't exist"
        fi
 
-       trap abort_prepare SIGINT SIGQUIT
+       trap __abort_prepare SIGINT SIGQUIT
 
-       ebuild_phase pre_src_prepare
+       __ebuild_phase pre_src_prepare
        __vecho ">>> Preparing source in $PWD ..."
-       ebuild_phase src_prepare
+       __ebuild_phase src_prepare
        >> "$PORTAGE_BUILDDIR/.prepared" || \
                die "Failed to create $PORTAGE_BUILDDIR/.prepared"
        __vecho ">>> Source prepared."
-       ebuild_phase post_src_prepare
+       __ebuild_phase post_src_prepare
 
        trap - SIGINT SIGQUIT
 }
 
-dyn_configure() {
+__dyn_configure() {
 
        if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
                __vecho ">>> It appears that '$PF' is already configured; skipping."
@@ -397,28 +397,28 @@ dyn_configure() {
                cd "${S}"
        elif has $EAPI 0 1 2 3 ; then
                cd "${WORKDIR}"
-       elif [[ -z ${A} ]] && ! has_phase_defined_up_to configure; then
+       elif [[ -z ${A} ]] && ! __has_phase_defined_up_to configure; then
                cd "${WORKDIR}"
        else
                die "The source directory '${S}' doesn't exist"
        fi
 
-       trap abort_configure SIGINT SIGQUIT
+       trap __abort_configure SIGINT SIGQUIT
 
-       ebuild_phase pre_src_configure
+       __ebuild_phase pre_src_configure
 
        __vecho ">>> Configuring source in $PWD ..."
-       ebuild_phase src_configure
+       __ebuild_phase src_configure
        >> "$PORTAGE_BUILDDIR/.configured" || \
                die "Failed to create $PORTAGE_BUILDDIR/.configured"
        __vecho ">>> Source configured."
 
-       ebuild_phase post_src_configure
+       __ebuild_phase post_src_configure
 
        trap - SIGINT SIGQUIT
 }
 
-dyn_compile() {
+__dyn_compile() {
 
        if [[ -e $PORTAGE_BUILDDIR/.compiled ]] ; then
                __vecho ">>> It appears that '${PF}' is already compiled; skipping."
@@ -430,13 +430,13 @@ dyn_compile() {
                cd "${S}"
        elif has $EAPI 0 1 2 3 ; then
                cd "${WORKDIR}"
-       elif [[ -z ${A} ]] && ! has_phase_defined_up_to compile; then
+       elif [[ -z ${A} ]] && ! __has_phase_defined_up_to compile; then
                cd "${WORKDIR}"
        else
                die "The source directory '${S}' doesn't exist"
        fi
 
-       trap abort_compile SIGINT SIGQUIT
+       trap __abort_compile SIGINT SIGQUIT
 
        if has distcc $FEATURES && has distcc-pump $FEATURES ; then
                if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
@@ -445,20 +445,20 @@ dyn_compile() {
                fi
        fi
 
-       ebuild_phase pre_src_compile
+       __ebuild_phase pre_src_compile
 
        __vecho ">>> Compiling source in $PWD ..."
-       ebuild_phase src_compile
+       __ebuild_phase src_compile
        >> "$PORTAGE_BUILDDIR/.compiled" || \
                die "Failed to create $PORTAGE_BUILDDIR/.compiled"
        __vecho ">>> Source compiled."
 
-       ebuild_phase post_src_compile
+       __ebuild_phase post_src_compile
 
        trap - SIGINT SIGQUIT
 }
 
-dyn_test() {
+__dyn_test() {
 
        if [[ -e $PORTAGE_BUILDDIR/.tested ]] ; then
                __vecho ">>> It appears that ${PN} has already been tested; skipping."
@@ -472,7 +472,7 @@ dyn_test() {
                ! has test ${USE} && export USE="${USE} test"
        fi
 
-       trap "abort_test" SIGINT SIGQUIT
+       trap "__abort_test" SIGINT SIGQUIT
        if [ -d "${S}" ]; then
                cd "${S}"
        else
@@ -487,18 +487,18 @@ dyn_test() {
        else
                local save_sp=${SANDBOX_PREDICT}
                addpredict /
-               ebuild_phase pre_src_test
-               ebuild_phase src_test
+               __ebuild_phase pre_src_test
+               __ebuild_phase src_test
                >> "$PORTAGE_BUILDDIR/.tested" || \
                        die "Failed to create $PORTAGE_BUILDDIR/.tested"
-               ebuild_phase post_src_test
+               __ebuild_phase post_src_test
                SANDBOX_PREDICT=${save_sp}
        fi
 
        trap - SIGINT SIGQUIT
 }
 
-dyn_install() {
+__dyn_install() {
        [ -z "$PORTAGE_BUILDDIR" ] && die "${FUNCNAME}: PORTAGE_BUILDDIR is unset"
        if has noauto $FEATURES ; then
                rm -f "${PORTAGE_BUILDDIR}/.installed"
@@ -507,8 +507,8 @@ dyn_install() {
                __vecho ">>> Remove '${PORTAGE_BUILDDIR}/.installed' to force install."
                return 0
        fi
-       trap "abort_install" SIGINT SIGQUIT
-       ebuild_phase pre_src_install
+       trap "__abort_install" SIGINT SIGQUIT
+       __ebuild_phase pre_src_install
 
        _x=${ED}
        [[ " ${FEATURES} " == *" force-prefix "* ]] || \
@@ -521,7 +521,7 @@ dyn_install() {
                cd "${S}"
        elif has $EAPI 0 1 2 3 ; then
                cd "${WORKDIR}"
-       elif [[ -z ${A} ]] && ! has_phase_defined_up_to install; then
+       elif [[ -z ${A} ]] && ! __has_phase_defined_up_to install; then
                cd "${WORKDIR}"
        else
                die "The source directory '${S}' doesn't exist"
@@ -541,12 +541,12 @@ dyn_install() {
        export _E_EXEDESTTREE_=""
        export _E_DOCDESTTREE_=""
 
-       ebuild_phase src_install
+       __ebuild_phase src_install
        >> "$PORTAGE_BUILDDIR/.installed" || \
                die "Failed to create $PORTAGE_BUILDDIR/.installed"
        __vecho ">>> Completed installing ${PF} into ${D}"
        __vecho
-       ebuild_phase post_src_install
+       __ebuild_phase post_src_install
 
        cd "${PORTAGE_BUILDDIR}"/build-info
        set -f
@@ -586,7 +586,7 @@ dyn_install() {
        # local variables can leak into the saved environment.
        unset f
 
-       save_ebuild_env --exclude-init-phases | filter_readonly_variables \
+       save_ebuild_env --exclude-init-phases | __filter_readonly_variables \
                --filter-path --filter-sandbox --allow-extra-vars > environment
        assert "save_ebuild_env failed"
 
@@ -601,15 +601,15 @@ dyn_install() {
        trap - SIGINT SIGQUIT
 }
 
-dyn_preinst() {
+__dyn_preinst() {
        if [ -z "${D}" ]; then
                eerror "${FUNCNAME}: D is unset"
                return 1
        fi
-       ebuild_phase_with_hooks pkg_preinst
+       __ebuild_phase_with_hooks pkg_preinst
 }
 
-dyn_help() {
+__dyn_help() {
        echo
        echo "Portage"
        echo "Copyright 1999-2010 Gentoo Foundation"
@@ -672,11 +672,11 @@ dyn_help() {
        echo
 }
 
-# @FUNCTION: _ebuild_arg_to_phase
+# @FUNCTION: __ebuild_arg_to_phase
 # @DESCRIPTION:
 # Translate a known ebuild(1) argument into the precise
 # name of it's corresponding ebuild phase.
-_ebuild_arg_to_phase() {
+__ebuild_arg_to_phase() {
        [ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
        local eapi=$1
        local arg=$2
@@ -732,7 +732,7 @@ _ebuild_arg_to_phase() {
        return 0
 }
 
-_ebuild_phase_funcs() {
+__ebuild_phase_funcs() {
        [ $# -ne 2 ] && die "expected exactly 2 args, got $#: $*"
        local eapi=$1
        local phase_func=$2
@@ -742,7 +742,7 @@ _ebuild_phase_funcs() {
 
        for x in pkg_nofetch src_unpack src_test ; do
                declare -F $x >/dev/null || \
-                       eval "$x() { _eapi0_$x \"\$@\" ; }"
+                       eval "$x() { __eapi0_$x \"\$@\" ; }"
        done
 
        case "$eapi" in
@@ -752,10 +752,10 @@ _ebuild_phase_funcs() {
                        if ! declare -F src_compile >/dev/null ; then
                                case "$eapi" in
                                        0)
-                                               src_compile() { _eapi0_src_compile "$@" ; }
+                                               src_compile() { __eapi0_src_compile "$@" ; }
                                                ;;
                                        *)
-                                               src_compile() { _eapi1_src_compile "$@" ; }
+                                               src_compile() { __eapi1_src_compile "$@" ; }
                                                ;;
                                esac
                        fi
@@ -775,35 +775,35 @@ _ebuild_phase_funcs() {
                *)
 
                        declare -F src_configure >/dev/null || \
-                               src_configure() { _eapi2_src_configure "$@" ; }
+                               src_configure() { __eapi2_src_configure "$@" ; }
 
                        declare -F src_compile >/dev/null || \
-                               src_compile() { _eapi2_src_compile "$@" ; }
+                               src_compile() { __eapi2_src_compile "$@" ; }
 
                        has $eapi 2 3 || declare -F src_install >/dev/null || \
-                               src_install() { _eapi4_src_install "$@" ; }
+                               src_install() { __eapi4_src_install "$@" ; }
 
                        if has $phase_func $default_phases ; then
 
-                               _eapi2_pkg_nofetch   () { _eapi0_pkg_nofetch          "$@" ; }
-                               _eapi2_src_unpack    () { _eapi0_src_unpack           "$@" ; }
-                               _eapi2_src_prepare   () { true                             ; }
-                               _eapi2_src_test      () { _eapi0_src_test             "$@" ; }
-                               _eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
+                               __eapi2_pkg_nofetch   () { __eapi0_pkg_nofetch          "$@" ; }
+                               __eapi2_src_unpack    () { __eapi0_src_unpack           "$@" ; }
+                               __eapi2_src_prepare   () { true                             ; }
+                               __eapi2_src_test      () { __eapi0_src_test             "$@" ; }
+                               __eapi2_src_install   () { die "$FUNCNAME is not supported" ; }
 
                                for x in $default_phases ; do
-                                       eval "default_$x() { _eapi2_$x \"\$@\" ; }"
+                                       eval "default_$x() { __eapi2_$x \"\$@\" ; }"
                                done
 
-                               eval "default() { _eapi2_$phase_func \"\$@\" ; }"
+                               eval "default() { __eapi2_$phase_func \"\$@\" ; }"
 
                                case "$eapi" in
                                        2|3)
                                                ;;
                                        *)
-                                               eval "default_src_install() { _eapi4_src_install \"\$@\" ; }"
+                                               eval "default_src_install() { __eapi4_src_install \"\$@\" ; }"
                                                [[ $phase_func = src_install ]] && \
-                                                       eval "default() { _eapi4_$phase_func \"\$@\" ; }"
+                                                       eval "default() { __eapi4_$phase_func \"\$@\" ; }"
                                                ;;
                                esac
 
@@ -825,7 +825,7 @@ _ebuild_phase_funcs() {
        esac
 }
 
-ebuild_main() {
+__ebuild_main() {
 
        # Subshell/helper die support (must export for the die helper).
        # Since this function is typically executed in a subshell,
@@ -861,15 +861,15 @@ ebuild_main() {
        # respect FEATURES="-ccache".
        has ccache $FEATURES || export CCACHE_DISABLE=1
 
-       local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
-       [[ -n $phase_func ]] && _ebuild_phase_funcs "$EAPI" "$phase_func"
+       local phase_func=$(__ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
+       [[ -n $phase_func ]] && __ebuild_phase_funcs "$EAPI" "$phase_func"
        unset phase_func
 
        source_all_bashrcs
 
        case ${1} in
        nofetch)
-               ebuild_phase_with_hooks pkg_nofetch
+               __ebuild_phase_with_hooks pkg_nofetch
                ;;
        prerm|postrm|postinst|config|info)
                if has "${1}" config info && \
@@ -878,17 +878,17 @@ ebuild_main() {
                fi
                export SANDBOX_ON="0"
                if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-                       ebuild_phase_with_hooks pkg_${1}
+                       __ebuild_phase_with_hooks pkg_${1}
                else
                        set -x
-                       ebuild_phase_with_hooks pkg_${1}
+                       __ebuild_phase_with_hooks pkg_${1}
                        set +x
                fi
                if [[ $EBUILD_PHASE == postinst ]] && [[ -n $PORTAGE_UPDATE_ENV ]]; then
                        # Update environment.bz2 in case installation phases
                        # need to pass some variables to uninstallation phases.
                        save_ebuild_env --exclude-init-phases | \
-                               filter_readonly_variables --filter-path \
+                               __filter_readonly_variables --filter-path \
                                --filter-sandbox --allow-extra-vars \
                                | ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
                        assert "save_ebuild_env failed"
@@ -952,10 +952,10 @@ ebuild_main() {
                esac
 
                if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-                       dyn_${1}
+                       __dyn_${1}
                else
                        set -x
-                       dyn_${1}
+                       __dyn_${1}
                        set +x
                fi
                export SANDBOX_ON="0"
@@ -966,10 +966,10 @@ ebuild_main() {
                #in /etc.  If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
                export SANDBOX_ON="0"
                if [ "${PORTAGE_DEBUG}" != "1" ] || [ "${-/x/}" != "$-" ]; then
-                       dyn_${1}
+                       __dyn_${1}
                else
                        set -x
-                       dyn_${1}
+                       __dyn_${1}
                        set +x
                fi
                ;;
@@ -979,7 +979,7 @@ ebuild_main() {
                export SANDBOX_ON="1"
                echo "Unrecognized arg '${1}'"
                echo
-               dyn_help
+               __dyn_help
                exit 1
                ;;
        esac
@@ -987,7 +987,7 @@ ebuild_main() {
        # Save the env only for relevant phases.
        if ! has "${1}" clean help info nofetch ; then
                umask 002
-               save_ebuild_env | filter_readonly_variables \
+               save_ebuild_env | __filter_readonly_variables \
                        --filter-features > "$T/environment"
                assert "save_ebuild_env failed"
                chown portage:portage "$T/environment" &>/dev/null
index 636336685d5eacb49f465ea51da72160a05457fe..6a249e1dd934e527cf1df0434543cdc29fc1fb9f 100644 (file)
@@ -409,7 +409,7 @@ econf() {
 
        _hasgq() { _hasg "$@" >/dev/null ; }
 
-       local phase_func=$(_ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
+       local phase_func=$(__ebuild_arg_to_phase "$EAPI" "$EBUILD_PHASE")
        if [[ -n $phase_func ]] ; then
                if has "$EAPI" 0 1 ; then
                        [[ $phase_func != src_compile ]] && \
@@ -552,7 +552,7 @@ einstall() {
        fi
 }
 
-_eapi0_pkg_nofetch() {
+__eapi0_pkg_nofetch() {
        [ -z "${SRC_URI}" ] && return
 
        elog "The following are listed in SRC_URI for ${PN}:"
@@ -562,18 +562,18 @@ _eapi0_pkg_nofetch() {
        done
 }
 
-_eapi0_src_unpack() {
+__eapi0_src_unpack() {
        [[ -n ${A} ]] && unpack ${A}
 }
 
-_eapi0_src_compile() {
+__eapi0_src_compile() {
        if [ -x ./configure ] ; then
                econf
        fi
-       _eapi2_src_compile
+       __eapi2_src_compile
 }
 
-_eapi0_src_test() {
+__eapi0_src_test() {
        # Since we don't want emake's automatic die
        # support (EAPI 4 and later), and we also don't
        # want the warning messages that it produces if
@@ -599,24 +599,24 @@ _eapi0_src_test() {
        fi
 }
 
-_eapi1_src_compile() {
-       _eapi2_src_configure
-       _eapi2_src_compile
+__eapi1_src_compile() {
+       __eapi2_src_configure
+       __eapi2_src_compile
 }
 
-_eapi2_src_configure() {
+__eapi2_src_configure() {
        if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
                econf
        fi
 }
 
-_eapi2_src_compile() {
+__eapi2_src_compile() {
        if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
                emake || die "emake failed"
        fi
 }
 
-_eapi4_src_install() {
+__eapi4_src_install() {
        if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
                emake DESTDIR="${D}" install
        fi
index f2deda225fe36758f2ffb13cde8c9a8d24ed925c..f3a723b01e738e39dcc831ad79dd418592034307 100644 (file)
@@ -42,7 +42,7 @@ save_ebuild_env() {
        for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \
                src_compile src_test src_install pkg_preinst pkg_postinst \
                pkg_prerm pkg_postrm ; do
-               unset -f default_$x _eapi{0,1,2,3,4}_$x
+               unset -f default_$x __eapi{0,1,2,3,4}_$x
        done
        unset x
 
@@ -51,24 +51,25 @@ save_ebuild_env() {
                __quiet_mode __vecho __elog_base eqawarn elog \
                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 \
+               __has_phase_defined_up_to \
                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 \
-               dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \
+               __dyn_setup __dyn_unpack __dyn_clean \
+               into insinto exeinto docinto \
                insopts diropts exeopts libopts docompress \
-               abort_handler abort_prepare abort_configure abort_compile \
-               abort_test abort_install dyn_prepare dyn_configure \
-               dyn_compile dyn_test dyn_install \
-               dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
+               __abort_handler __abort_prepare __abort_configure __abort_compile \
+               __abort_test __abort_install __dyn_prepare dyn_configure \
+               __dyn_compile dyn_test dyn_install \
+               __dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
                debug-print-section __helpers_die inherit EXPORT_FUNCTIONS \
                nonfatal register_success_hook \
-               save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
+               save_ebuild_env __filter_readonly_variables __preprocess_ebuild_env \
                source_all_bashrcs \
-               ebuild_main ebuild_phase ebuild_phase_with_hooks \
-               _ebuild_arg_to_phase _ebuild_phase_funcs default \
+               __ebuild_main __ebuild_phase __ebuild_phase_with_hooks \
+               __ebuild_arg_to_phase __ebuild_phase_funcs default \
                _hasg _hasgq _unpack_tar \
                ${QA_INTERCEPTORS}
 
index a6426eed595b3607815c1b6521becac1ce00d64a..89b6050022421dbfa8df14f9b33078ee45b8498f 100644 (file)
@@ -1261,7 +1261,7 @@ def _spawn_actionmap(settings):
        misc_sh_binary = os.path.join(portage_bin_path,
                os.path.basename(MISC_SH_BINARY))
        ebuild_sh = _shell_quote(ebuild_sh_binary) + " %s"
-       misc_sh = _shell_quote(misc_sh_binary) + " dyn_%s"
+       misc_sh = _shell_quote(misc_sh_binary) + " __dyn_%s"
 
        # args are for the to spawn function
        actionmap = {