diff options
Diffstat (limited to 'sys-apps/pkgcore/files')
-rw-r--r-- | sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-r1.patch | 67 | ||||
-rw-r--r-- | sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr.patch | 47 |
2 files changed, 0 insertions, 114 deletions
diff --git a/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-r1.patch b/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-r1.patch deleted file mode 100644 index a48bfc5873bb..000000000000 --- a/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr-r1.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 303826ceb22985cfa1dfbf1e7a68ed327ffc741b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> -Date: Sat, 15 May 2021 09:30:58 +0200 -Subject: [PATCH] pytest: Delay loading pkgcore modules until fixtures are used - -Delay loading pkgcore modules until the EbuildRepo-based fixtures are -actually used. This prevents the pkgcore signal handlers from being -enabled on all packages using pytest while keeping the old behavior -of setting them upon import in packages using pkgcore directly. ---- - src/pkgcore/pytest/plugin.py | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/src/pkgcore/pytest/plugin.py b/src/pkgcore/pytest/plugin.py -index 082538ab..bdc89e4b 100644 ---- a/src/pkgcore/pytest/plugin.py -+++ b/src/pkgcore/pytest/plugin.py -@@ -1,3 +1,4 @@ -+import importlib - import os - import subprocess - import textwrap -@@ -5,8 +6,6 @@ from collections.abc import MutableSet - from datetime import datetime - - import pytest --from pkgcore.ebuild import cpv as cpv_mod --from pkgcore.ebuild import repo_objs, repository - from snakeoil import klass - from snakeoil.fileutils import touch - from snakeoil.osutils import pjoin -@@ -169,6 +168,12 @@ class EbuildRepo: - """Class for creating/manipulating ebuild repos.""" - - def __init__(self, path, repo_id='fake', eapi='5', masters=(), arches=()): -+ # load pkgcore modules late to avoid overriding signal handlers -+ # when the plugin is not actually used -+ self.cpv_mod = importlib.import_module('pkgcore.ebuild.cpv') -+ self.repo_objs = importlib.import_module('pkgcore.ebuild.repo_objs') -+ self.repository = importlib.import_module('pkgcore.ebuild.repository') -+ - self.path = path - self.arches = _FileSet(pjoin(self.path, 'profiles', 'arch.list')) - self._today = datetime.today() -@@ -194,8 +199,8 @@ class EbuildRepo: - - def sync(self): - """Forcibly create underlying repo object avoiding cache usage.""" -- repo_config = repo_objs.RepoConfig(location=self.path, disable_inst_caching=True) -- self._repo = repository.UnconfiguredTree(self.path, repo_config=repo_config) -+ repo_config = self.repo_objs.RepoConfig(location=self.path, disable_inst_caching=True) -+ self._repo = self.repository.UnconfiguredTree(self.path, repo_config=repo_config) - - def create_profiles(self, profiles): - for p in profiles: -@@ -215,7 +220,7 @@ class EbuildRepo: - f.write(f'{p.eapi}\n') - - def create_ebuild(self, cpvstr, data=None, **kwargs): -- cpv = cpv_mod.VersionedCPV(cpvstr) -+ cpv = self.cpv_mod.VersionedCPV(cpvstr) - self._repo.notify_add_package(cpv) - ebuild_dir = pjoin(self.path, cpv.category, cpv.package) - os.makedirs(ebuild_dir, exist_ok=True) --- -2.31.1 - diff --git a/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr.patch b/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr.patch deleted file mode 100644 index 30cec9114f56..000000000000 --- a/sys-apps/pkgcore/files/pkgcore-0.10.18-sighdlr.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 533f1edd70054a5479ee85719d3cbef0d15627fd Mon Sep 17 00:00:00 2001 -From: Tim Harder <radhermit@gmail.com> -Date: Sun, 28 Mar 2021 17:18:16 -0600 -Subject: [PATCH] ebuild.processor: register SIGINT and SIGTERM signal handlers - on ebd init - -Rather than at a global, module level to avoid issues with inadvertent -issues during 3rd party imports, e.g. the pkgcore pytest plugin getting -autoloaded by some other project's testsuite. ---- - src/pkgcore/ebuild/processor.py | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/src/pkgcore/ebuild/processor.py b/src/pkgcore/ebuild/processor.py -index e8c3c2cd4..65437efcf 100644 ---- a/src/pkgcore/ebuild/processor.py -+++ b/src/pkgcore/ebuild/processor.py -@@ -275,9 +275,6 @@ def chuck_KeyboardInterrupt(*args): - raise KeyboardInterrupt("ctrl+c encountered") - - --signal.signal(signal.SIGINT, chuck_KeyboardInterrupt) -- -- - def chuck_TermInterrupt(ebp, *args): - """Event handler for SIGTERM.""" - if ebp is None: -@@ -292,9 +289,6 @@ def chuck_TermInterrupt(ebp, *args): - ebp.shutdown_processor() - - --signal.signal(signal.SIGTERM, partial(chuck_TermInterrupt, None)) -- -- - def chuck_UnhandledCommand(ebp, line): - """Event handler for unhandled commands.""" - raise UnhandledCommand(line) -@@ -332,6 +326,9 @@ def __init__(self, userpriv, sandbox, fd_pipes=None): - self._outstanding_expects = [] - self._metadata_paths = None - -+ signal.signal(signal.SIGTERM, partial(chuck_TermInterrupt, None)) -+ signal.signal(signal.SIGINT, chuck_KeyboardInterrupt) -+ - if userpriv: - self.__userpriv = True - spawn_opts.update({ |