From: Zac Medico Date: Tue, 17 Aug 2010 05:38:49 +0000 (-0700) Subject: Make EbuildBuild check the manifest before beginning, since with X-Git-Tag: v2.2_rc68~136 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=81bf93ee53524ca403058506d307a8d9109df57a;p=portage.git Make EbuildBuild check the manifest before beginning, since with --keep-going mode it's currently possible to get this far with a broken manifest. --- 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