Fix emerge --fetch --digest for bug #470238.
authorZac Medico <zmedico@gentoo.org>
Sat, 18 May 2013 12:20:23 +0000 (05:20 -0700)
committerZac Medico <zmedico@gentoo.org>
Sat, 18 May 2013 12:20:23 +0000 (05:20 -0700)
pym/_emerge/EbuildBuild.py
pym/_emerge/EbuildFetcher.py

index 599875a320a8715f5994ac76f191f7e361083407..845b11582e9f39a846c16ca901d7ac10a47a5304 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildExecuter import EbuildExecuter
@@ -15,6 +15,7 @@ import portage
 from portage import os
 from portage.output import colorize
 from portage.package.ebuild.digestcheck import digestcheck
+from portage.package.ebuild.digestgen import digestgen
 from portage.package.ebuild.doebuild import _check_temp_dir
 from portage.package.ebuild._spawn_nofetch import spawn_nofetch
 
@@ -91,7 +92,8 @@ class EbuildBuild(CompositeTask):
                success = True
 
                settings = self.settings
-               if 'strict' in settings.features:
+               if 'strict' in settings.features and \
+                       'digest' not in settings.features:
                        settings['O'] = os.path.dirname(self._ebuild_path)
                        quiet_setting = settings.get('PORTAGE_QUIET')
                        settings['PORTAGE_QUIET'] = '1'
@@ -160,6 +162,10 @@ class EbuildBuild(CompositeTask):
                if self.returncode != os.EX_OK:
                        portdb = self.pkg.root_config.trees[self._tree].dbapi
                        spawn_nofetch(portdb, self._ebuild_path, settings=self.settings)
+               if 'digest' in self.settings.features:
+                       if not digestgen(mysettings=self.settings,
+                               myportdb=self.pkg.root_config.trees[self._tree].dbapi):
+                               self.returncode = 1
                self.wait()
 
        def _pre_clean_exit(self, pre_clean_phase):
index df790b0d3681ab18cdb6ee16291a17001d1fd831..d98d00736e83bdeea1463ef9d229ecdd87f1d719 100644 (file)
@@ -165,7 +165,8 @@ class EbuildFetcher(ForkProcess):
                        not in ('yes', 'true')
 
                rval = 1
-               allow_missing = self._get_manifest().allow_missing
+               allow_missing = self._get_manifest().allow_missing or \
+                       'digest' in self._settings.features
                if fetch(self._uri_map, self._settings, fetchonly=self.fetchonly,
                        digests=copy.deepcopy(self._get_digests()),
                        allow_missing_digests=allow_missing):