From 350b384386bffe5af2bde394f92d54d19ad8d6e4 Mon Sep 17 00:00:00 2001 From: Sérgio M. Basto Date: Apr 30 2025 12:53:15 +0000 Subject: [PATCH 1/2] Use nvr function instead repeat the same calculation I notices when I use copr-build use one calculation and when I use mockbuild use the other and both should be always the same self._nvr = '%s-%s-%s' % (self.repo_name, self.ver, self.rel) self.srpmname = os.path.join(self.layout.srcrpmdir, "%s-%s-%s.src.rpm" % (self.repo_name, self.ver, self.rel)) --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 96420cf..bb283b5 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -3367,8 +3367,7 @@ class Commands(object): """ self.srpmname = os.path.join(self.layout.srcrpmdir, - "%s-%s-%s.src.rpm" - % (self.repo_name, self.ver, self.rel)) + "%s.src.rpm" % (self.nvr)) # See if we need to build the srpm if os.path.exists(self.srpmname): From a985b60da07142b577927e3bb5def50097fa1f87 Mon Sep 17 00:00:00 2001 From: Sérgio M. Basto Date: Apr 30 2025 12:53:15 +0000 Subject: [PATCH 2/2] Use the spec name to guess the src.rpm name --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index bb283b5..a911dc0 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -667,7 +667,7 @@ class Commands(object): def load_nvr(self): """This sets the nvr attribute""" - self._nvr = '%s-%s-%s' % (self.repo_name, self.ver, self.rel) + self._nvr = '%s-%s-%s' % (self.spec.removesuffix(".spec"), self.ver, self.rel) @property def rel(self):