summaryrefslogtreecommitdiff
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
parentportage-2.1.4.1 (trunk r9264) (diff)
downloadportage-multirepo-b9106505a3075b9547c2d177e2c5e782c591b057.tar.gz
portage-multirepo-b9106505a3075b9547c2d177e2c5e782c591b057.tar.bz2
portage-multirepo-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
-rwxr-xr-xbin/ebuild.sh10
-rw-r--r--bin/isolated-functions.sh3
-rw-r--r--pym/portage.py6
3 files changed, 17 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 61799ad8..eca24c62 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 5750ce8d..ee73e7bc 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 \
diff --git a/pym/portage.py b/pym/portage.py
index c844d6ff..43dc6704 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1021,7 +1021,7 @@ class config:
"PORTAGE_IUSE",
"PORTAGE_LOG_FILE", "PORTAGE_MASTER_PID",
"PORTAGE_PYM_PATH", "PORTAGE_REPO_NAME", "PORTAGE_RESTRICT",
- "PORTAGE_TMPDIR", "PORTAGE_WORKDIR_MODE",
+ "PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV", "PORTAGE_WORKDIR_MODE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
"ROOT", "ROOTPATH", "STARTDIR", "T", "TMP", "TMPDIR",
"USE_EXPAND", "USE_ORDER", "WORKDIR",
@@ -9133,8 +9133,12 @@ class dblink:
del conf_mem_file
#do postinst script
+ self.settings["PORTAGE_UPDATE_ENV"] = \
+ os.path.join(self.dbpkgdir, "environment.bz2")
+ self.settings.backup_changes("PORTAGE_UPDATE_ENV")
a = doebuild(myebuild, "postinst", destroot, self.settings, use_cache=0,
tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
+ self.settings.pop("PORTAGE_UPDATE_ENV", None)
# XXX: Decide how to handle failures here.
if a != os.EX_OK: