From 0d22dd6b813c4b7b49b1109ce332778e0e4cfc28 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 18 May 2013 05:20:23 -0700 Subject: [PATCH] Fix emerge --fetch --digest for bug #470238. --- pym/_emerge/EbuildBuild.py | 10 ++++++++-- pym/_emerge/EbuildFetcher.py | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 599875a32..845b11582 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -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): diff --git a/pym/_emerge/EbuildFetcher.py b/pym/_emerge/EbuildFetcher.py index df790b0d3..d98d00736 100644 --- a/pym/_emerge/EbuildFetcher.py +++ b/pym/_emerge/EbuildFetcher.py @@ -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): -- 2.26.2