From 9594954287fe2f2caa4a0e3985fa3666c4cb060c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 9 Sep 2024 10:28:28 +0200 Subject: [PATCH] Drop compatibility helper for dnf.Package.source_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bug that caused the attribute to have wrong value has been fixed in DNF a long time ago. Fixes: https://pagure.io/pungi/issue/1786 Signed-off-by: Lubomír Sedlář (cherry picked from commit 225f04cf43326c136e95356681f1461270673ca6) --- pungi/gather_dnf.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index 96c7005b..beeec294 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -35,11 +35,6 @@ from pungi.profiler import Profiler from pungi.util import DEBUG_PATTERNS -def get_source_name(pkg): - # Workaround for rhbz#1418298 - return pkg.sourcerpm.rsplit("-", 2)[0] - - def filter_dotarch(queue, pattern, **kwargs): """Filter queue for packages matching the pattern. If pattern matches the dotarch format of ., it is processed as such. Otherwise it is @@ -389,7 +384,7 @@ class Gather(GatherBase): # lookaside if self.is_from_lookaside(i): self._set_flag(i, PkgFlag.lookaside) - if i.sourcerpm.rsplit("-", 2)[0] in self.opts.fulltree_excludes: + if i.source_name in self.opts.fulltree_excludes: self._set_flag(i, PkgFlag.fulltree_exclude) def _get_package_deps(self, pkg, debuginfo=False): @@ -839,7 +834,7 @@ class Gather(GatherBase): continue if self.is_from_lookaside(i): self._set_flag(i, PkgFlag.lookaside) - srpm_name = i.sourcerpm.rsplit("-", 2)[0] + srpm_name = i.source_name if srpm_name in self.opts.fulltree_excludes: self._set_flag(i, PkgFlag.fulltree_exclude) if PkgFlag.input in self.result_package_flags.get(srpm_name, set()): @@ -871,7 +866,7 @@ class Gather(GatherBase): for pkg in sorted(self.result_binary_packages): assert pkg is not None - if get_source_name(pkg) in self.opts.fulltree_excludes: + if pkg.source_name in self.opts.fulltree_excludes: self.logger.debug("No fulltree for %s due to exclude list", pkg) continue