summaryrefslogtreecommitdiff
path: root/0008-Update-to-spec-file-presence-checking.patch
diff options
context:
space:
mode:
Diffstat (limited to '0008-Update-to-spec-file-presence-checking.patch')
-rw-r--r--0008-Update-to-spec-file-presence-checking.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/0008-Update-to-spec-file-presence-checking.patch b/0008-Update-to-spec-file-presence-checking.patch
new file mode 100644
index 0000000..723415f
--- /dev/null
+++ b/0008-Update-to-spec-file-presence-checking.patch
@@ -0,0 +1,43 @@
+From 791fd03b4de1324508583ab53c89cc67459db355 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Tue, 21 Mar 2023 13:44:38 +0100
+Subject: [PATCH 08/12] Update to spec file presence checking
+
+Using a different approach to checking the layout. Older way prevented
+`retire` function working correctly. Layouts are detected at the
+beginning of the run and the result stays the same, unlike the direct
+checking files like dead.package in function `is_retired`.
+
+Fixes: #663
+JIRA: RHELCMP-11387
+
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 028d195..e8f4886 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -925,7 +925,7 @@ class Commands(object):
+
+ if self.layout is None or isinstance(self.layout, layout.IncompleteLayout):
+ raise rpkgError('Spec file is not available')
+- if self.is_retired():
++ if isinstance(self.layout, layout.RetiredLayout):
+ raise rpkgError('This package or module is retired. The action has stopped.')
+
+ # Get a list of ".spec" files in the path we're looking at
+@@ -1167,7 +1167,7 @@ class Commands(object):
+ def sources_filename(self):
+ if self.layout is None or isinstance(self.layout, layout.IncompleteLayout):
+ raise rpkgError('Spec file is not available')
+- if self.is_retired():
++ if isinstance(self.layout, layout.RetiredLayout):
+ raise rpkgError('This package or module is retired. The action has stopped.')
+ return os.path.join(
+ self.path, self.layout.sources_file_template.replace("{0.repo_name}", self.repo_name))
+--
+2.39.2
+