diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-10-07 23:30:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-10-07 23:30:04 +0000 |
commit | d557bea6d2c3bc311d03f5a4887092957586a16d (patch) | |
tree | 82529f35aa18d1d5b4256f70fd0b453bf2517a91 /pym | |
parent | 753da5d98709eb5705254bfe208918d683abc262 (diff) | |
download | portage-d557bea6d2c3bc311d03f5a4887092957586a16d.tar.gz portage-d557bea6d2c3bc311d03f5a4887092957586a16d.tar.bz2 portage-d557bea6d2c3bc311d03f5a4887092957586a16d.zip |
Bug #287950 - Add support for FEATURES=fail-clean which is useful for cleaning
up temp files on tmpfs after build failures with --keep-going.
svn path=/main/trunk/; revision=14517
Diffstat (limited to 'pym')
-rw-r--r-- | pym/_emerge/EbuildPhase.py | 25 | ||||
-rw-r--r-- | pym/portage/dbapi/vartree.py | 5 |
2 files changed, 29 insertions, 1 deletions
diff --git a/pym/_emerge/EbuildPhase.py b/pym/_emerge/EbuildPhase.py index 51f018cb1..fcf60d39c 100644 --- a/pym/_emerge/EbuildPhase.py +++ b/pym/_emerge/EbuildPhase.py @@ -45,6 +45,11 @@ class EbuildPhase(CompositeTask): log_file.close() if self._default_exit(ebuild_process) != os.EX_OK: + if self.phase != 'clean' and \ + 'noclean' not in self.settings.features and \ + 'fail-clean' in self.settings.features: + self._fail_clean() + return self.wait() return @@ -80,7 +85,27 @@ class EbuildPhase(CompositeTask): if self._final_exit(post_phase) != os.EX_OK: writemsg("!!! post %s failed; exiting.\n" % self.phase, noiselevel=-1) + if self.phase != 'clean' and \ + 'noclean' not in self.settings.features and \ + 'fail-clean' in self.settings.features: + self._fail_clean() + return self._current_task = None self.wait() return + def _fail_clean(self): + self.returncode = None + portage.elog.elog_process(self.pkg.cpv, self.settings) + phase = "clean" + clean_phase = EbuildPhase(background=self.background, + pkg=self.pkg, phase=phase, + scheduler=self.scheduler, settings=self.settings, + tree=self.tree) + self._start_task(clean_phase, self._fail_clean_exit) + return + + def _fail_clean_exit(self, clean_phase): + self._final_exit(clean_phase) + self.returncode = 1 + self.wait() diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5971ca647..c103cbd8d 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -4349,7 +4349,10 @@ class dblink(object): # Process ebuild logfiles elog_process(self.mycpv, self.settings, phasefilter=filter_mergephases) - if retval == os.EX_OK and "noclean" not in self.settings.features: + if 'noclean' not in self.settings.features and \ + (retval == os.EX_OK or \ + ('fail-clean' in self.settings.features and \ + os.path.isdir(self.settings['PORTAGE_BUILDDIR']))): if myebuild is None: myebuild = os.path.join(inforoot, self.pkg + ".ebuild") |