From b359e6ae6aeb66a5cbeeffeba57c2d96757e3ea9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Thu, 9 Dec 2021 04:19:10 +0000 Subject: [PATCH] import dnf-plugins-core-4.0.21-7.el8 --- ...t-resolving-of-packages-RhBug2013633.patch | 31 ++++++ ...lock-fix-multi-pkg-lock-RhBug2013324.patch | 95 +++++++++++++++++++ ...adding-specific-version-RhBug2013332.patch | 31 ++++++ SPECS/dnf-plugins-core.spec | 10 +- 4 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0007-groups-manager-More-benevolent-resolving-of-packages-RhBug2013633.patch create mode 100644 SOURCES/0008-versionlock-fix-multi-pkg-lock-RhBug2013324.patch create mode 100644 SOURCES/0009-Update-documentation-for-adding-specific-version-RhBug2013332.patch diff --git a/SOURCES/0007-groups-manager-More-benevolent-resolving-of-packages-RhBug2013633.patch b/SOURCES/0007-groups-manager-More-benevolent-resolving-of-packages-RhBug2013633.patch new file mode 100644 index 0000000..274f1c5 --- /dev/null +++ b/SOURCES/0007-groups-manager-More-benevolent-resolving-of-packages-RhBug2013633.patch @@ -0,0 +1,31 @@ +From 5c8f753503be87e5d6237be12eec2330236d78ed Mon Sep 17 00:00:00 2001 +From: Marek Blaha +Date: Mon, 8 Nov 2021 16:51:56 +0100 +Subject: [PATCH] groups-manager: More benevolent resolving of packages (RhBug:2013633) + += changelog = +msg: groups-manager uses for matching packages full NEVRA and not only name. +type: enhancement +resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2013633 +--- + plugins/groups_manager.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/plugins/groups_manager.py b/plugins/groups_manager.py +index 382df37..12da183 100644 +--- a/plugins/groups_manager.py ++++ b/plugins/groups_manager.py +@@ -254,7 +254,9 @@ class GroupsManagerCommand(dnf.cli.Command): + # find packages according to specifications from command line + packages = set() + for pkg_spec in self.opts.packages: +- q = self.base.sack.query().filterm(name__glob=pkg_spec).latest() ++ subj = dnf.subject.Subject(pkg_spec) ++ q = subj.get_best_query(self.base.sack, with_nevra=True, ++ with_provides=False, with_filenames=False).latest() + if not q: + logger.warning(_("No match for argument: {}").format(pkg_spec)) + continue +-- +libgit2 1.1.0 + diff --git a/SOURCES/0008-versionlock-fix-multi-pkg-lock-RhBug2013324.patch b/SOURCES/0008-versionlock-fix-multi-pkg-lock-RhBug2013324.patch new file mode 100644 index 0000000..d517175 --- /dev/null +++ b/SOURCES/0008-versionlock-fix-multi-pkg-lock-RhBug2013324.patch @@ -0,0 +1,95 @@ +From 0030ea94dd261b66cac6f08c9dfa99e3d8ee3648 Mon Sep 17 00:00:00 2001 +From: Nicola Sella +Date: Mon, 1 Nov 2021 18:29:40 +0100 +Subject: [PATCH] [versionlock] fix multi pkg lock (RhBug:2013324) + += changelog = +msg: [versionlock] Fix: Multiple package-name-spec arguments don't lock +correctly (RhBug:2001039) +type: bugfix +resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2013324 +--- + plugins/versionlock.py | 57 +++++++++++++++++++++++++++++++++------------------------ + 1 file changed, 33 insertions(+), 24 deletions(-) + +diff --git a/plugins/versionlock.py b/plugins/versionlock.py +index c89a75d..77b7f91 100644 +--- a/plugins/versionlock.py ++++ b/plugins/versionlock.py +@@ -167,25 +167,27 @@ class VersionLockCommand(dnf.cli.Command): + cmd = self.opts.subcommand + + if cmd == 'add': +- (entry, entry_cmd) = _search_locklist(self.opts.package) +- if entry == '': +- _write_locklist(self.base, self.opts.package, self.opts.raw, True, +- "\n# Added lock on %s\n" % time.ctime(), +- ADDING_SPEC, '') +- elif cmd != entry_cmd: +- raise dnf.exceptions.Error(ALREADY_EXCLUDED.format(entry)) +- else: +- logger.info("%s %s", EXISTING_SPEC, entry) ++ results = _search_locklist(self.opts.package) ++ for entry, entry_cmd in results: ++ if entry_cmd == '': ++ _write_locklist(self.base, [entry], self.opts.raw, True, ++ "\n# Added lock on %s\n" % time.ctime(), ++ ADDING_SPEC, '') ++ elif cmd != entry_cmd: ++ raise dnf.exceptions.Error(ALREADY_EXCLUDED.format(entry)) ++ else: ++ logger.info("%s %s", EXISTING_SPEC, entry) + elif cmd == 'exclude': +- (entry, entry_cmd) = _search_locklist(self.opts.package) +- if entry == '': +- _write_locklist(self.base, self.opts.package, self.opts.raw, False, +- "\n# Added exclude on %s\n" % time.ctime(), +- EXCLUDING_SPEC, '!') +- elif cmd != entry_cmd: +- raise dnf.exceptions.Error(ALREADY_LOCKED.format(entry)) +- else: +- logger.info("%s %s", EXISTING_SPEC, entry) ++ results = _search_locklist(self.opts.package) ++ for entry, entry_cmd in results: ++ if entry_cmd == '': ++ _write_locklist(self.base, [entry], self.opts.raw, False, ++ "\n# Added exclude on %s\n" % time.ctime(), ++ EXCLUDING_SPEC, '!') ++ elif cmd != entry_cmd: ++ raise dnf.exceptions.Error(ALREADY_LOCKED.format(entry)) ++ else: ++ logger.info("%s %s", EXISTING_SPEC, entry) + elif cmd == 'list': + for pat in _read_locklist(): + print(pat) +@@ -233,14 +235,21 @@ def _read_locklist(): + + + def _search_locklist(package): ++ results = [] + found = action = '' + locked_specs = _read_locklist() +- for ent in locked_specs: +- if _match(ent, package): +- found = ent +- action = 'exclude' if ent.startswith('!') else 'add' +- break +- return (found, action) ++ for pkg in package: ++ match = False ++ for ent in locked_specs: ++ found = action = '' ++ if _match(ent, [pkg]): ++ found = ent ++ action = 'exclude' if ent.startswith('!') else 'add' ++ results.append((found, action)) ++ match = True ++ if not match: ++ results.append((pkg, action)) ++ return results + + + def _write_locklist(base, args, raw, try_installed, comment, info, prefix): +-- +libgit2 1.1.0 + diff --git a/SOURCES/0009-Update-documentation-for-adding-specific-version-RhBug2013332.patch b/SOURCES/0009-Update-documentation-for-adding-specific-version-RhBug2013332.patch new file mode 100644 index 0000000..445c330 --- /dev/null +++ b/SOURCES/0009-Update-documentation-for-adding-specific-version-RhBug2013332.patch @@ -0,0 +1,31 @@ +From ed05ce74cfb9151ea5218da0f8b9eccb70c00f70 Mon Sep 17 00:00:00 2001 +From: Nicola Sella +Date: Thu, 11 Nov 2021 13:48:39 +0100 +Subject: [PATCH] Update documentation for adding specific version (RhBug:2013332) + +=changelog= +msg: [versionlock] update documentation for adding specifi version +type: bugfix +resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2013332 +--- + doc/versionlock.rst | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/doc/versionlock.rst b/doc/versionlock.rst +index 061ce80..1ac7196 100644 +--- a/doc/versionlock.rst ++++ b/doc/versionlock.rst +@@ -97,6 +97,10 @@ Subcommands + Adding versionlock on: mutt-5:1.11.4-1.fc30.* + Adding versionlock on: mutt-5:1.12.1-3.fc30.* + ++ .. note:: Be careful when adding specific versions ++ ++ If you add a package specifying a version with ``dnf versionlock mutt-5:1.11.4-1.fc30.x86_64`` then, if you run ``dnf versionlock add mutt`` ++ versionlock will not add ``mutt-5:1.12.1-3.fc30.x86_64``. + + ``dnf versionlock exclude `` + Add an exclude (within versionlock) for the available packages matching the spec. It means that +-- +libgit2 1.1.0 + diff --git a/SPECS/dnf-plugins-core.spec b/SPECS/dnf-plugins-core.spec index 35575f9..faf7636 100644 --- a/SPECS/dnf-plugins-core.spec +++ b/SPECS/dnf-plugins-core.spec @@ -34,7 +34,7 @@ Name: dnf-plugins-core Version: 4.0.21 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Core Plugins for DNF License: GPLv2+ URL: https://github.com/rpm-software-management/dnf-plugins-core @@ -45,6 +45,9 @@ Patch3: 0003-repomanage-Enhance-repomanage-documentation-RhBug1898293.pa Patch4: 0004-copr-dont-traceback-on-empty-lines-in-etcos-release.patch Patch5: 0005-reposync-Use-fail_fastFalse-when-downloading-packages-RhBug2009894.patch Patch6: 0006-copr-migrate-all-calls-to-APIv3.patch +Patch7: 0007-groups-manager-More-benevolent-resolving-of-packages-RhBug2013633.patch +Patch8: 0008-versionlock-fix-multi-pkg-lock-RhBug2013324.patch +Patch9: 0009-Update-documentation-for-adding-specific-version-RhBug2013332.patch BuildArch: noarch BuildRequires: cmake @@ -768,6 +771,11 @@ ln -sf %{_mandir}/man1/%{yum_utils_subpackage_name}.1.gz %{buildroot}%{_mandir}/ %endif %changelog +* Wed Dec 1 2021 Pavla Kratochvilova - 4.0.21-7 +- [groups-manager] Use full NEVRA for matching packages instead of only name (RhBug:2013633) +- [versionlock] Fix: Multiple package-name-spec arguments don't lock (RhBug:2013324) +- [versionlock] Update documentation for adding specifi version (RhBug:2013332) + * Tue Nov 23 2021 Pavla Kratochvilova - 4.0.21-6 - Increase dependency on dnf as it's required by reposync (RhBug:2023739)