[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/commit/, repoman/pym/repoman/
commit: 4de81f973a9edfcac9ef2f02759d87c43bf86560 Author: Zac Medico gentoo org> AuthorDate: Mon Jun 20 10:14:38 2016 + Commit: Zac Medico gentoo org> CommitDate: Mon Jun 20 17:51:29 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=4de81f97 repoman: fix KeyError during manifest generation (bug 585388) Fix Scanner not to override portdbapi._aux_cache_keys when generating manifests, since spawn_nofetch requires additional keys. Fixes: 87e32d4863f3 ("repoman: fix KeyError...during manifest generation (bug 569942)") X-Gentoo-Bug: 585388 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=585388 Acked-by: Brian Dolbec gentoo.org> repoman/pym/repoman/modules/commit/manifest.py | 91 +- repoman/pym/repoman/scanner.py | 12 +++- 2 files changed, 53 insertions(+), 50 deletions(-) diff --git a/repoman/pym/repoman/modules/commit/manifest.py b/repoman/pym/repoman/modules/commit/manifest.py index 475dae4..b338a5b 100644 --- a/repoman/pym/repoman/modules/commit/manifest.py +++ b/repoman/pym/repoman/modules/commit/manifest.py @@ -33,55 +33,52 @@ class Manifest(object): @returns: dictionary ''' self.generated_manifest = False - self.digest_only = self.options.mode != 'manifest-check' \ - and self.options.digest == 'y' - if self.options.mode in ("manifest", 'commit', 'fix') or self.digest_only: - failed = False - self.auto_assumed = set() - fetchlist_dict = portage.FetchlistDict( - checkdir, self.repoman_settings, self.portdb) - if self.options.mode == 'manifest' and self.options.force: - self._discard_dist_digests(checkdir, fetchlist_dict) - self.repoman_settings["O"] = checkdir - try: - self.generated_manifest = digestgen( - mysettings=self.repoman_settings, myportdb=self.portdb) - except portage.exception.PermissionDenied as e: - self.generated_manifest = False - writemsg_level( - "!!! Permission denied: '%s'\n" % (e,), - level=logging.ERROR, noiselevel=-1) + failed = False + self.auto_assumed = set() + fetchlist_dict = portage.FetchlistDict( + checkdir, self.repoman_settings, self.portdb) + if self.options.mode == 'manifest' and self.options.force: + self._discard_dist_digests(checkdir, fetchlist_dict) + self.repoman_settings["O"] = checkdir + try: + self.generated_manifest = digestgen( + mysettings=self.repoman_settings, myportdb=self.portdb) + except portage.exception.PermissionDenied as e: + self.generated_manifest = False + writemsg_level( + "!!! Permission denied: '%s'\n" % (e,), + level=logging.ERROR, noiselevel=-1) - if not self.generated_manifest: - writemsg_level( - "Unable to generate manifest.", - level=logging.ERROR, noiselevel=-1) - failed = True + if not self.generated_manifest: + writemsg_level( + "Unable to generate manifest.", + level=logging.ERROR, noiselevel=-1) + failed = True - if self.options.mode == "manifest": - if not failed and self.options.force and self.auto_assumed and \ - 'assume-digests' in self.repoman_settings.features: - # Show which digests were assumed despite the --force option - # being given. This output will already have been shown by - # digestgen() if assume-digests is not enabled, so only show - # it here if assume-digests is enabled. - pkgs = list(fetchlist_dict) - pkgs.sort() - portage.writemsg_stdout( - " digest.assumed %s" % - portage.output.colorize( - "WARN",
[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/commit/
commit: 72d09cf05b1998302c7847624cea56328dbbf6e6 Author: Zac Medico gentoo org> AuthorDate: Mon Jun 20 09:41:27 2016 + Commit: Zac Medico gentoo org> CommitDate: Mon Jun 20 09:45:21 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=72d09cf0 repoman: clarify --force manifest code Fixes: 005f56110e90 ("Make manifest mode with --force option...") repoman/pym/repoman/modules/commit/manifest.py | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/repoman/pym/repoman/modules/commit/manifest.py b/repoman/pym/repoman/modules/commit/manifest.py index 498bfa4..475dae4 100644 --- a/repoman/pym/repoman/modules/commit/manifest.py +++ b/repoman/pym/repoman/modules/commit/manifest.py @@ -41,7 +41,7 @@ class Manifest(object): fetchlist_dict = portage.FetchlistDict( checkdir, self.repoman_settings, self.portdb) if self.options.mode == 'manifest' and self.options.force: - self._create_manifest(checkdir, fetchlist_dict) + self._discard_dist_digests(checkdir, fetchlist_dict) self.repoman_settings["O"] = checkdir try: self.generated_manifest = digestgen( @@ -84,8 +84,15 @@ class Manifest(object): sys.exit(1) return False - def _create_manifest(self, checkdir, fetchlist_dict): - '''Creates a Manifest file + def _discard_dist_digests(self, checkdir, fetchlist_dict): + '''Discard DIST digests for files that exist in DISTDIR + + This method is intended to be called prior to digestgen, only for + manifest mode with the --force option, in order to discard DIST + digests that we intend to update. This is necessary because + digestgen never replaces existing digests, since otherwise it + would be too easy for ebuild developers to accidentally corrupt + existing DIST digests. @param checkdir: the directory to generate the Manifest in @param fetchlist_dict: dictionary of files to fetch and/or include
[gentoo-commits] proj/portage:master commit in: repoman/pym/repoman/modules/commit/
commit: fa14c0e3deb86e1e140b60876de1e695e5979944 Author: Zac Medico gentoo org> AuthorDate: Mon Jun 20 07:52:06 2016 + Commit: Zac Medico gentoo org> CommitDate: Mon Jun 20 07:52:06 2016 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=fa14c0e3 repoman: organize _doebuild_manifest_exempt_depend code Increments and decrements of _doebuild_manifest_exempt_depend are meant to be paired, since they are supposed to cancel eachother out. repoman/pym/repoman/modules/commit/manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repoman/pym/repoman/modules/commit/manifest.py b/repoman/pym/repoman/modules/commit/manifest.py index ce4c024..498bfa4 100644 --- a/repoman/pym/repoman/modules/commit/manifest.py +++ b/repoman/pym/repoman/modules/commit/manifest.py @@ -41,7 +41,6 @@ class Manifest(object): fetchlist_dict = portage.FetchlistDict( checkdir, self.repoman_settings, self.portdb) if self.options.mode == 'manifest' and self.options.force: - portage._doebuild_manifest_exempt_depend += 1 self._create_manifest(checkdir, fetchlist_dict) self.repoman_settings["O"] = checkdir try: @@ -92,6 +91,7 @@ class Manifest(object): @param fetchlist_dict: dictionary of files to fetch and/or include in the manifest ''' + portage._doebuild_manifest_exempt_depend += 1 try: distdir = self.repoman_settings['DISTDIR'] mf = self.repoman_settings.repositories.get_repo_for_location(