summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-02-07 23:40:30 +0000
committerZac Medico <zmedico@gentoo.org>2008-02-07 23:40:30 +0000
commitb9106505a3075b9547c2d177e2c5e782c591b057 (patch)
tree06d172a0250c67415d1270c7117c2a157106ca5f /bin
parent56f1ecb663097aa9174edd7af3200726a8dcc410 (diff)
downloadportage-b9106505a3075b9547c2d177e2c5e782c591b057.tar.gz
portage-b9106505a3075b9547c2d177e2c5e782c591b057.tar.bz2
portage-b9106505a3075b9547c2d177e2c5e782c591b057.zip
Bug #155993 - Update environment.bz2 after postinst in case
installation phases need to pass some variables to uninstallation phases. (trunk r9281) svn path=/main/branches/2.1.2/; revision=9282
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild.sh10
-rw-r--r--bin/isolated-functions.sh3
2 files changed, 12 insertions, 1 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 61799ad88..eca24c626 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1777,6 +1777,16 @@ if [ -n "${EBUILD_SH_ARGS}" ] ; then
ebuild_phase_with_hooks pkg_${EBUILD_SH_ARGS}
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.
+ (
+ unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_
+ save_ebuild_env | filter_readonly_variables \
+ --filter-sandbox --allow-extra-vars | \
+ bzip2 -c -f9 > "$PORTAGE_UPDATE_ENV"
+ )
+ fi
;;
unpack|compile|test|clean|install)
if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5750ce8dd..ee73e7bcd 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -470,7 +470,8 @@ save_ebuild_env() {
PORTAGE_COLORMAP PORTAGE_CONFIGROOT PORTAGE_DEBUG \
PORTAGE_DEPCACHEDIR PORTAGE_GID PORTAGE_INST_GID \
PORTAGE_INST_UID PORTAGE_LOG_FILE PORTAGE_MASTER_PID \
- PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_WORKDIR_MODE PORTDIR \
+ PORTAGE_REPO_NAME PORTAGE_RESTRICT PORTAGE_UPDATE_ENV \
+ PORTAGE_WORKDIR_MODE PORTDIR \
PORTDIR_OVERLAY ${!PORTAGE_SANDBOX_*} PREROOTPATH \
PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \
RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \