[gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/_parallel_manifest/
commit: 07dbfbdf0504387fe96f865440550b720245f0bb Author: Zac Medico gentoo org> AuthorDate: Thu Oct 5 04:36:43 2023 + Commit: Zac Medico gentoo org> CommitDate: Thu Oct 5 04:37:06 2023 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=07dbfbdf ManifestProcess: Migrate to ForkProcess target parameter Bug: https://bugs.gentoo.org/915099 Signed-off-by: Zac Medico gentoo.org> .../ebuild/_parallel_manifest/ManifestProcess.py | 28 +- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/portage/package/ebuild/_parallel_manifest/ManifestProcess.py b/lib/portage/package/ebuild/_parallel_manifest/ManifestProcess.py index f1a30670b4..ec2d5bdfc2 100644 --- a/lib/portage/package/ebuild/_parallel_manifest/ManifestProcess.py +++ b/lib/portage/package/ebuild/_parallel_manifest/ManifestProcess.py @@ -1,6 +1,8 @@ -# Copyright 2012 Gentoo Foundation +# Copyright 2012-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +import functools + import portage from portage import os from portage.exception import FileNotFound, PermissionDenied, PortagePackageException @@ -13,11 +15,25 @@ class ManifestProcess(ForkProcess): MODIFIED = 16 -def _run(self): -mf = self.repo_config.load_manifest( -os.path.join(self.repo_config.location, self.cp), +def _start(self): +self.target = functools.partial( +self._target, +self.cp, self.distdir, -fetchlist_dict=self.fetchlist_dict, +self.fetchlist_dict, +self.repo_config, +) +super()._start() + +@staticmethod +def _target(cp, distdir, fetchlist_dict, repo_config): +""" +TODO: Make all arguments picklable for the multiprocessing spawn start method. +""" +mf = repo_config.load_manifest( +os.path.join(repo_config.location, cp), +distdir, +fetchlist_dict=fetchlist_dict, ) try: @@ -43,5 +59,5 @@ class ManifestProcess(ForkProcess): return 1 else: if modified: -return self.MODIFIED +return ManifestProcess.MODIFIED return os.EX_OK
[gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/_parallel_manifest/, lib/_emerge/, lib/portage/, ...
commit: 7f62c28184516d0461c12185ecaa79571369037c Author: Sam James gentoo org> AuthorDate: Wed Jul 26 08:04:35 2023 + Commit: Sam James gentoo org> CommitDate: Wed Jul 26 08:21:18 2023 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f62c281 Run `flynt` Signed-off-by: Sam James gentoo.org> lib/_emerge/UseFlagDisplay.py | 2 +- lib/portage/_emirrordist/ContentDB.py | 4 ++-- lib/portage/_emirrordist/DeletionTask.py | 14 ++--- lib/portage/_emirrordist/FetchTask.py | 3 +-- lib/portage/_emirrordist/MirrorDistTask.py | 24 -- lib/portage/_emirrordist/main.py | 12 --- lib/portage/output.py | 4 ++-- .../ebuild/_parallel_manifest/ManifestProcess.py | 2 +- lib/portage/package/ebuild/digestgen.py| 2 +- lib/portage/tests/util/test_uniqueArray.py | 3 +-- 10 files changed, 29 insertions(+), 41 deletions(-) diff --git a/lib/_emerge/UseFlagDisplay.py b/lib/_emerge/UseFlagDisplay.py index 4c526947d..7027db86a 100644 --- a/lib/_emerge/UseFlagDisplay.py +++ b/lib/_emerge/UseFlagDisplay.py @@ -109,6 +109,6 @@ def pkg_use_display(pkg, opts, modified_use=None): flags.sort(key=UseFlagDisplay.sort_combined) else: flags.sort(key=UseFlagDisplay.sort_separated) -flag_displays.append(f"{varname}=\"{' '.join('{}'.format(f) for f in flags)}\"") +flag_displays.append(f"{varname}=\"{' '.join(f'{f}' for f in flags)}\"") return " ".join(flag_displays) diff --git a/lib/portage/_emirrordist/ContentDB.py b/lib/portage/_emirrordist/ContentDB.py index c9e5f3e7b..622a437aa 100644 --- a/lib/portage/_emirrordist/ContentDB.py +++ b/lib/portage/_emirrordist/ContentDB.py @@ -112,10 +112,10 @@ class ContentDB: pass if remaining: -logger.debug(("drop '%s' revision(s) from content db") % filename) +logger.debug(f"drop '{filename}' revision(s) from content db") self._shelve[distfile_key] = remaining else: -logger.debug(("drop '%s' from content db") % filename) +logger.debug(f"drop '{filename}' from content db") try: del self._shelve[distfile_key] except KeyError: diff --git a/lib/portage/_emirrordist/DeletionTask.py b/lib/portage/_emirrordist/DeletionTask.py index cb8174d10..2dd97237b 100644 --- a/lib/portage/_emirrordist/DeletionTask.py +++ b/lib/portage/_emirrordist/DeletionTask.py @@ -20,10 +20,10 @@ class DeletionTask(CompositeTask): recycle_path = os.path.join(self.config.options.recycle_dir, self.distfile) if self.config.options.dry_run: logger.info( -("dry-run: move '%s' from " "distfiles to recycle") % self.distfile +f"dry-run: move '{self.distfile}' from distfiles to recycle" ) else: -logger.debug(("move '%s' from " "distfiles to recycle") % self.distfile) +logger.debug(f"move '{self.distfile}' from distfiles to recycle") try: # note: distfile_path can be a symlink here os.rename(os.path.realpath(self.distfile_path), recycle_path) @@ -51,9 +51,9 @@ class DeletionTask(CompositeTask): success = True if self.config.options.dry_run: -logger.info(("dry-run: delete '%s' from " "distfiles") % self.distfile) +logger.info(f"dry-run: delete '{self.distfile}' from distfiles") else: -logger.debug(("delete '%s' from " "distfiles") % self.distfile) +logger.debug(f"delete '{self.distfile}' from distfiles") try: os.unlink(self.distfile_path) except OSError as e: @@ -102,7 +102,7 @@ class DeletionTask(CompositeTask): success = True for layout in self.config.layouts: if isinstance(layout, ContentHashLayout) and not self.distfile.digests: -logger.debug(("_delete_links: '%s' has " "no digests") % self.distfile) +logger.debug(f"_delete_links: '{self.distfile}' has no digests") continue distfile_path = os.path.join( self.config.options.distfiles, layout.get_path(self.distfile) @@ -134,7 +134,7 @@ class DeletionTask(CompositeTask): except KeyError: pass else: -logger.debug(("drop '%s' from " "distfiles db") % self.distfile) +logger.debug(f"drop '{self.distfile}' from distfiles db") if self.config.content_db is not None: self.config.content_db.remove(self.distfile) @@ -145,4 +145,4 @@ class DeletionTask(CompositeTask): except KeyError:
[gentoo-commits] proj/portage:master commit in: lib/portage/package/ebuild/_parallel_manifest/
commit: 2cc4dd4f73b07e8c1fa99cfc84c0f713d56854af Author: Alec Warner gentoo org> AuthorDate: Thu Jul 23 06:16:01 2020 + Commit: Zac Medico gentoo org> CommitDate: Thu Jul 23 06:56:10 2020 + URL:https://gitweb.gentoo.org/proj/portage.git/commit/?id=2cc4dd4f Fix extra file. This file had 2 extra newlines, so was missed in the earlier commit. Signed-off-by: Alec Warner gentoo.org> Change-Id: Idd613c618b9411f01bf0ab5d488079131988f311 Closes: https://github.com/gentoo/portage/pull/586 Signed-off-by: Zac Medico gentoo.org> lib/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py b/lib/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py index aca42c1e1..2ac736bc6 100644 --- a/lib/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py +++ b/lib/portage/package/ebuild/_parallel_manifest/ManifestScheduler.py @@ -84,4 +84,3 @@ class ManifestScheduler(AsyncScheduler): noiselevel=-1) AsyncScheduler._task_exit(self, task) -