diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-18 17:52:10 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-18 17:52:10 -0700 |
commit | 214ba4d809e352cadde48dfc9f8b203cb1bd21a6 (patch) | |
tree | 60fbdf8f24c5280d5dc29f083aab1202db830470 | |
parent | 0379fb1602260763117db1f6611a4bf6db7f25bf (diff) | |
download | portage-214ba4d809e352cadde48dfc9f8b203cb1bd21a6.tar.gz portage-214ba4d809e352cadde48dfc9f8b203cb1bd21a6.tar.bz2 portage-214ba4d809e352cadde48dfc9f8b203cb1bd21a6.zip |
Use doebuild_environment() to ensure proper environment initialization
for clean/cleanrm phases, and use the simpler _spawn_phase() function
instead of doebuild to spawn the phases.
-rw-r--r-- | pym/portage/dbapi/vartree.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 2b2912ded..80057e2dd 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -15,7 +15,7 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.elog:elog_process', 'portage.locks:lockdir,unlockdir', 'portage.output:bold,colorize', - 'portage.package.ebuild.doebuild:doebuild,doebuild_environment,' + \ + 'portage.package.ebuild.doebuild:doebuild_environment,' + \ '_spawn_phase', 'portage.package.ebuild.prepare_build_dirs:prepare_build_dirs', 'portage.update:fixdbentries', @@ -2178,7 +2178,7 @@ class dblink(object): builddir_lock = None catdir_lock = None scheduler = self._scheduler - retval = -1 + retval = os.EX_OK failures = 0 try: if myebuildpath: @@ -2300,20 +2300,25 @@ class dblink(object): # process logs created during pre/postrm elog_process(self.mycpv, self.settings) - if retval == os.EX_OK: - if scheduler is None: - doebuild(myebuildpath, "cleanrm", self.myroot, - self.settings, tree="vartree", - mydbapi=self.vartree.dbapi, - vartree=self.vartree) - else: - scheduler.dblinkEbuildPhase( - self, self.vartree.dbapi, - myebuildpath, "cleanrm") + + if retval == os.EX_OK: + # myebuildpath might be None, so ensure + # it has a sane value for the clean phase, + # even though it won't really be sourced. + myebuildpath = os.path.join(self.dbdir, + self.pkg + ".ebuild") + doebuild_environment(myebuildpath, "cleanrm", self.myroot, + self.settings, 0, 0, self.vartree.dbapi) + if scheduler is None: + _spawn_phase("cleanrm", self.settings) + else: + scheduler.dblinkEbuildPhase( + self, self.vartree.dbapi, + myebuildpath, "cleanrm") finally: unlockdir(builddir_lock) try: - if myebuildpath and not catdir_lock: + if not catdir_lock: # Lock catdir for removal if empty. catdir_lock = lockdir(catdir) finally: @@ -4463,10 +4468,10 @@ class dblink(object): if myebuild is None: myebuild = os.path.join(inforoot, self.pkg + ".ebuild") + doebuild_environment(myebuild, "clean", self.myroot, + self.settings, 0, 0, mydbapi) if self._scheduler is None: - doebuild(myebuild, "clean", myroot, - self.settings, tree=self.treetype, - mydbapi=mydbapi, vartree=self.vartree) + _spawn_phase("clean", self.settings) else: self._scheduler.dblinkEbuildPhase( self, mydbapi, myebuild, "clean") |