summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-08-08 06:49:34 +0000
committerZac Medico <zmedico@gentoo.org>2008-08-08 06:49:34 +0000
commit536eead0b367f9365d1d1574aff3a37a56b96d47 (patch)
tree9086aa5f81a2f781de19cc392dcf3dc3ae51f988 /bin/isolated-functions.sh
parentShorten the scheduler status display in the xterm title by removing all (diff)
downloadportage-multirepo-536eead0b367f9365d1d1574aff3a37a56b96d47.tar.gz
portage-multirepo-536eead0b367f9365d1d1574aff3a37a56b96d47.tar.bz2
portage-multirepo-536eead0b367f9365d1d1574aff3a37a56b96d47.zip
* Fix the default() implementation so that it maps the ebuild argument to
the correct phase function. * Add --exclude-init-phases option to save_ebuild_env() for filtering out unnecessary functions and variables when creating environment.bz2. * Add support for default() and default_* functions that die in all ebuild phases so that improper use of these functions is quickly discovered. svn path=/main/trunk/; revision=11346
Diffstat (limited to 'bin/isolated-functions.sh')
-rwxr-xr-xbin/isolated-functions.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 364df5bb..378e03f9 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -507,9 +507,24 @@ hasq() {
# @FUNCTION: save_ebuild_env
# @DESCRIPTION:
# echo the current environment to stdout, filtering out redundant info.
+#
+# --exclude-init-phases causes pkg_nofetch and src_* phase functions to
+# 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() {
(
+ if hasq --exclude-init-phases $* ; then
+ unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
+ unset -f pkg_nofetch src_unpack src_configure \
+ src_compile src_test src_install
+ if [[ -n $PYTHONPATH ]] ; then
+ export PYTHONPATH=${PYTHONPATH/${PORTAGE_PYM_PATH}:}
+ [[ -z $PYTHONPATH ]] && unset PYTHONPATH
+ fi
+ fi
+
# misc variables set by bash
unset BASH HOSTTYPE IFS MACHTYPE OLDPWD \
OPTERR OPTIND OSTYPE PS4 PWD SHELL SHLVL
@@ -528,6 +543,13 @@ save_ebuild_env() {
# There's no need to bloat environment.bz2 with internally defined
# functions and variables, so filter them out if possible.
+ for x in pkg_setup pkg_nofetch src_unpack src_configure \
+ src_compile src_test src_install pkg_preinst pkg_postinst \
+ pkg_prerm pkg_postrm ; do
+ unset -f {,_}default_$x
+ done
+ unset x
+
unset -f dump_trace die 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 \
@@ -546,6 +568,7 @@ save_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 \
${QA_INTERCEPTORS}
# portage config variables and variables set directly by portage