# @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
+# 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.
# until we've merged them with our current values.
export SANDBOX_ON=0
- # It's remotely possible that save_ebuild_env() has been overridden
+ # It's remotely possible that __save_ebuild_env() has been overridden
# by the above source command. To protect ourselves, we override it
# here with our own version. ${PORTAGE_BIN_PATH} is safe to use here
# because it's already filtered above.
source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || exit $?
- # Rely on save_ebuild_env() to filter out any remaining variables
+ # Rely on __save_ebuild_env() to filter out any remaining variables
# and functions that could interfere with the current environment.
- save_ebuild_env || exit $?
+ __save_ebuild_env || exit $?
>> "$T/environment.success" || exit $?
) > "${T}/environment.filtered"
local retval
# 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"
+ assert "__save_ebuild_env failed"
${PORTAGE_BZIP2_COMMAND} -f9 environment
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 | \
+ __save_ebuild_env --exclude-init-phases | \
__filter_readonly_variables --filter-path \
--filter-sandbox --allow-extra-vars \
| ${PORTAGE_BZIP2_COMMAND} -c -f9 > "$PORTAGE_UPDATE_ENV"
- assert "save_ebuild_env failed"
+ assert "__save_ebuild_env failed"
fi
;;
unpack|prepare|configure|compile|test|clean|install)
# 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"
+ assert "__save_ebuild_env failed"
chown portage:portage "$T/environment" &>/dev/null
chmod g+w "$T/environment" &>/dev/null
fi
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# @FUNCTION: save_ebuild_env
+# @FUNCTION: __save_ebuild_env
# @DESCRIPTION:
# echo the current environment to stdout, filtering out redundant info.
#
# be excluded from the output. These function are not needed for installation
# or removal of the packages, and can therefore be safely excluded.
#
-save_ebuild_env() {
+__save_ebuild_env() {
(
if has --exclude-init-phases $* ; then
unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ \
__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 \