Blob Blame History Raw
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