Blame SOURCES/0002-repomanage-Allow-running-only-with-metadata.patch

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