dnf-plugins-core/SOURCES/0002-repomanage-Allow-running-only-with-metadata.patch
2021-10-08 10:27:29 +00:00

50 lines
1.9 KiB
Diff

From 716c5978a8036df22d6f5b430ba38c35d034f3ea Mon Sep 17 00:00:00 2001
From: Aleš Matěj <amatej@redhat.com>
Date: Tue, 8 Jun 2021 10:25:55 +0200
Subject: [PATCH] [repomanage] Allow running only with metadata
Requiring some packages to be present even if there are repodata was
arbitrary because they are never used.
---
plugins/repomanage.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/plugins/repomanage.py b/plugins/repomanage.py
index 445006d..989bd78 100644
--- a/plugins/repomanage.py
+++ b/plugins/repomanage.py
@@ -58,18 +58,13 @@ class RepoManageCommand(dnf.cli.Command):
if self.opts.new and self.opts.old:
raise dnf.exceptions.Error(_("Pass either --old or --new, not both!"))
- rpm_list = []
- rpm_list = self._get_file_list(self.opts.path, ".rpm")
verfile = {}
pkgdict = {}
module_dict = {} # {NameStream: {Version: [modules]}}
all_modular_artifacts = set()
keepnum = int(self.opts.keep) # the number of items to keep
- if len(rpm_list) == 0:
- raise dnf.exceptions.Error(_("No files to process"))
-
try:
repo_conf = self.base.repos.add_new_repo("repomanage_repo", self.base.conf, baseurl=[self.opts.path])
# Always expire the repo, otherwise repomanage could use cached metadata and give identical results
@@ -88,6 +83,11 @@ class RepoManageCommand(dnf.cli.Command):
module_package.getVersionNum(), []).append(module_package)
except dnf.exceptions.RepoError:
+ rpm_list = []
+ rpm_list = self._get_file_list(self.opts.path, ".rpm")
+ if len(rpm_list) == 0:
+ raise dnf.exceptions.Error(_("No files to process"))
+
self.base.reset(sack=True, repos=True)
self.base.fill_sack(load_system_repo=False, load_available_repos=False)
try:
--
libgit2 1.0.1