diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-11 06:36:48 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-11 06:36:48 +0000 |
commit | 5003a47d1b9cc09b21184eb5483633f84f5f8cfd (patch) | |
tree | 8f375018532f2677a687ca2b92e478b2154b4c0d | |
parent | 557ba117817275b2bb21e51a26c0a145fdca8c63 (diff) | |
download | portage-5003a47d1b9cc09b21184eb5483633f84f5f8cfd.tar.gz portage-5003a47d1b9cc09b21184eb5483633f84f5f8cfd.tar.bz2 portage-5003a47d1b9cc09b21184eb5483633f84f5f8cfd.zip |
* When installing a binary package, export the file name of the package
as PORTAGE_BINPKG_FILE in order to give bashrc users an opportunity
to do various things such as remove binary packages after they're
installed.
* Add a note in ebuild.sh explaining why hardcoded bash lists are
needed for backward compatibility with <portage-2.1.4 since they
assume that a newly installed version of ebuild.sh will work for
pkg_postinst, pkg_prerm, and pkg_postrm when portage is upgrading
itself.
svn path=/main/trunk/; revision=8878
-rwxr-xr-x | bin/ebuild.sh | 7 | ||||
-rw-r--r-- | pym/portage/__init__.py | 9 |
2 files changed, 14 insertions, 2 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index f1d42bd01..fbccce70c 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1355,12 +1355,17 @@ source_all_bashrcs() { [ ! -z "${OCXX}" ] && export CXX="${OCXX}" } +# Hardcoded bash lists are needed for backward compatibility with +# <portage-2.1.4 since they assume that a newly installed version +# of ebuild.sh will work for pkg_postinst, pkg_prerm, and pkg_postrm +# when portage is upgrading itself. + READONLY_EBUILD_METADATA="DEPEND DESCRIPTION EAPI HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI" READONLY_PORTAGE_VARS="D EBUILD EBUILD_PHASE \ - EBUILD_SH_ARGS EMERGE_FROM FILESDIR \ + EBUILD_SH_ARGS EMERGE_FROM FILESDIR PORTAGE_BINPKG_FILE \ PORTAGE_BIN_PATH PORTAGE_PYM_PATH PORTAGE_MUTABLE_FILTERED_VARS \ PORTAGE_SAVED_READONLY_VARS PORTAGE_TMPDIR T WORKDIR" diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index c5ef5fb04..bbb0c57a0 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -875,7 +875,9 @@ class config(object): "FEATURES", "FILESDIR", "HOME", "PATH", "PKGUSE", "PKG_LOGDIR", "PKG_TMPDIR", "PORTAGE_ACTUAL_DISTDIR", "PORTAGE_ARCHLIST", - "PORTAGE_BASHRC", "PORTAGE_BINPKG_TMPFILE", "PORTAGE_BIN_PATH", + "PORTAGE_BASHRC", + "PORTAGE_BINPKG_FILE", "PORTAGE_BINPKG_TMPFILE", + "PORTAGE_BIN_PATH", "PORTAGE_BUILDDIR", "PORTAGE_COLORMAP", "PORTAGE_CONFIGROOT", "PORTAGE_DEBUG", "PORTAGE_DEPCACHEDIR", "PORTAGE_GID", "PORTAGE_INST_GID", "PORTAGE_INST_UID", @@ -5815,6 +5817,10 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes fp.write(str(portage.checksum.perform_md5(mytbz2))+"\n") fp.close() + # This gives bashrc users an opportunity to do various things + # such as remove binary packages after they're installed. + mysettings["PORTAGE_BINPKG_FILE"] = mytbz2 + mysettings.backup_changes("PORTAGE_BINPKG_FILE") debug = mysettings.get("PORTAGE_DEBUG", "") == "1" # Eventually we'd like to pass in the saved ebuild env here. @@ -5841,6 +5847,7 @@ def pkgmerge(mytbz2, myroot, mysettings, mydbapi=None, vartree=None, prev_mtimes did_merge_phase = True return retval finally: + mysettings.pop("PORTAGE_BINPKG_FILE", None) if tbz2_lock: portage.locks.unlockfile(tbz2_lock) if builddir_lock: |