diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-16 22:38:49 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-16 22:38:49 -0700 |
commit | 81bf93ee53524ca403058506d307a8d9109df57a (patch) | |
tree | f293d483b175647496b7c6d40dac67b27331d415 | |
parent | fc1eae78e3f086da4ce8fb32504b7a3d615d054c (diff) | |
download | portage-81bf93ee53524ca403058506d307a8d9109df57a.tar.gz portage-81bf93ee53524ca403058506d307a8d9109df57a.tar.bz2 portage-81bf93ee53524ca403058506d307a8d9109df57a.zip |
Make EbuildBuild check the manifest before beginning, since with
--keep-going mode it's currently possible to get this far with a
broken manifest.
-rw-r--r-- | pym/_emerge/EbuildBuild.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 060c830f4..b8694df96 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -17,6 +17,7 @@ from portage import _encodings from portage import _unicode_encode import codecs from portage.output import colorize +from portage.package.ebuild.digestcheck import digestcheck from portage.package.ebuild.doebuild import _check_temp_dir class EbuildBuild(CompositeTask): @@ -49,6 +50,14 @@ class EbuildBuild(CompositeTask): raise AssertionError("ebuild not found for '%s'" % pkg.cpv) self._ebuild_path = ebuild_path + # Check the manifest here since with --keep-going mode it's + # currently possible to get this far with a broken manifest. + if not self._check_manifest(): + self.returncode = 1 + self._current_task = None + self.wait() + return + prefetcher = self.prefetcher if prefetcher is None: pass @@ -74,6 +83,24 @@ class EbuildBuild(CompositeTask): self._prefetch_exit(prefetcher) + def _check_manifest(self): + success = True + + settings = self.settings + if 'strict' in settings.features: + settings['O'] = os.path.dirname(self._ebuild_path) + quiet_setting = settings.get('PORTAGE_QUIET') + settings['PORTAGE_QUIET'] = '1' + try: + success = digestcheck([], settings, strict=True) + finally: + if quiet_setting: + settings['PORTAGE_QUIET'] = quiet_setting + else: + del settings['PORTAGE_QUIET'] + + return success + def _prefetch_exit(self, prefetcher): opts = self.opts |