diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-11-25 22:56:57 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-11-25 22:56:57 +0000 |
commit | da5c280b6014b011e32dfe811ac0284cd641a459 (patch) | |
tree | e9db8bdaf3f7e0570129d7ba39194f943f3bbe58 /bin/isolated-functions.sh | |
parent | 7cc4d8790966ffd7dd715460e07120040d84160e (diff) | |
download | portage-da5c280b6014b011e32dfe811ac0284cd641a459.tar.gz portage-da5c280b6014b011e32dfe811ac0284cd641a459.tar.bz2 portage-da5c280b6014b011e32dfe811ac0284cd641a459.zip |
Make preprocess_ebuild_env() reload a known good version of
save_ebuild_env() in order to avoid making an assumption that
it hasn't been overridden. (trunk r8663)
svn path=/main/branches/2.1.2/; revision=8665
Diffstat (limited to 'bin/isolated-functions.sh')
-rw-r--r-- | bin/isolated-functions.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index d24e42e2f..c116f3c2c 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -379,4 +379,72 @@ hasq() { [[ " ${*:2} " == *" $1 "* ]] } +# @FUNCTION: save_ebuild_env +# @DESCRIPTION: +# echo the current environment to stdout, filtering out redundant info. +save_ebuild_env() { + ( + + # misc variables set by bash + unset BASH HOSTTYPE IFS MACHTYPE OLDPWD \ + OPTERR OPTIND OSTYPE PS4 PWD SHELL + + # misc variables inherited from the calling environment + unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \ + TERM TERMCAP USER + + # There's no need to bloat environment.bz2 with internally defined + # functions and variables, so filter them out if possible. + + unset -f dump_trace diefunc quiet_mode vecho elog_base eqawarn elog \ + esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \ + KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \ + hasv hasq qa_source qa_call addread addwrite adddeny addpredict \ + lchown lchgrp esyslog use usev useq has_version portageq \ + best_version use_with use_enable register_die_hook check_KV \ + keepdir unpack strip_duplicate_slashes econf einstall gen_wrapper \ + dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \ + insopts diropts exeopts libopts abort_handler abort_compile \ + abort_test abort_install dyn_compile dyn_test dyn_install \ + dyn_preinst dyn_help debug-print debug-print-function \ + debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \ + newpdepend do_newdepend remove_path_entry killparent \ + save_ebuild_env filter_readonly_variables preprocess_ebuild_env \ + source_all_bashrcs ebuild_phase ebuild_phase_with_hooks + + # portage config variables and variables set directly by portage + unset ACCEPT_KEYWORDS AUTOCLEAN BAD BRACKET BUILD_PREFIX CLEAN_DELAY \ + COLLISION_IGNORE COLS CONFIG_PROTECT CONFIG_PROTECT_MASK \ + DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR EBUILD_MASTER_PID \ + ECLASSDIR ECLASS_DEPTH EMERGE_DEFAULT_OPTS \ + EMERGE_WARNING_DELAY ENDCOL FAKEROOTKEY FEATURES \ + FETCHCOMMAND FETCHCOMMAND_FTP FETCHCOMMAND_HTTP FETCHCOMMAND_SFTP \ + GENTOO_MIRRORS GOOD HILITE HOME IMAGE \ + KV LAST_E_CMD LAST_E_LEN LD_PRELOAD MOPREFIX \ + NORMAL O PATH PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \ + PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \ + PORTAGE_BINHOST_CHUNKSIZE PORTAGE_BINPKG_TMPFILE \ + PORTAGE_BUILDDIR PORTAGE_CALLER \ + PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \ + PORTAGE_DEPCACHEDIR PORTAGE_ELOG_CLASSES PORTAGE_ELOG_MAILFROM \ + PORTAGE_ELOG_MAILSUBJECT PORTAGE_ELOG_MAILURI PORTAGE_ELOG_SYSTEM \ + PORTAGE_GID PORTAGE_GPG_DIR PORTAGE_GPG_KEY PORTAGE_INST_GID \ + PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \ + PORTAGE_REPO_NAME PORTAGE_RESTRICT \ + PORTAGE_RSYNC_EXTRA_OPTS PORTAGE_RSYNC_OPTS \ + PORTAGE_RSYNC_RETRIES PORTAGE_TMPFS PORTAGE_WORKDIR_MODE PORTDIR \ + PORTDIR_OVERLAY PORT_LOGDIR PROFILE_PATHS PWORKDIR \ + QUICKPKG_DEFAULT_OPTS QA_INTERCEPTORS \ + RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \ + RC_INDENTATION READONLY_EBUILD_METADATA READONLY_PORTAGE_VARS \ + RESUMECOMMAND RESUMECOMMAND_HTTP \ + RESUMECOMMAND_HTTP RESUMECOMMAND_SFTP ROOT ROOTPATH RPMDIR \ + STARTDIR SYNC TMP TMPDIR USE_EXPAND \ + USE_EXPAND_HIDDEN USE_ORDER WARN XARGS + + set + export + ) +} + true |