From 29bedf2ccc94df9a7f973e77d67854b09656533d Mon Sep 17 00:00:00 2001 From: Till Maas Date: Wed, 26 Jul 2017 22:25:47 +0200 Subject: [PATCH] Use pungi.util.pkg_is_debug() instead of pungi.gather.is_debug() There is no reason to have two functions for the same job. Signed-off-by: Till Maas --- pungi/gather.py | 10 +++------- pungi/multilib_yum.py | 3 ++- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pungi/gather.py b/pungi/gather.py index 8d77c757..378649d7 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -66,10 +66,6 @@ def yumlocked(method): return wrapper -def is_debug(po): - return "debuginfo" in po.name or "debugsource" in po.name - - def is_source(po): if po.arch in ("src", "nosrc"): return True @@ -83,7 +79,7 @@ def is_noarch(po): def is_package(po): - if is_debug(po): + if pungi.util.pkg_is_debug(po): return False if is_source(po): return False @@ -444,7 +440,7 @@ class Pungi(PungiBase): self.sourcerpm_arch_map.setdefault(po.sourcerpm, set()).add(po.arch) def add_debuginfo(self, po, msg=None): - if not is_debug(po): + if not pungi.util.pkg_is_debug(po): raise ValueError("Not a debuginfog package: %s" % po) if msg: self.logger.info(msg) @@ -1172,7 +1168,7 @@ class Pungi(PungiBase): added = set() for po in self.all_pkgs: - if not is_debug(po): + if not pungi.util.pkg_is_debug(po): continue if po.sourcerpm not in self.sourcerpm_arch_map: diff --git a/pungi/multilib_yum.py b/pungi/multilib_yum.py index 993b9381..c58c9638 100755 --- a/pungi/multilib_yum.py +++ b/pungi/multilib_yum.py @@ -18,6 +18,7 @@ import fnmatch import pungi.pathmatch import pungi.gather +import pungi.util @@ -96,7 +97,7 @@ class MultilibMethodBase(object): raise NotImplementedError def skip(self, po): - if pungi.gather.is_noarch(po) or pungi.gather.is_source(po) or pungi.gather.is_debug(po): + if pungi.gather.is_noarch(po) or pungi.gather.is_source(po) or pungi.util.pkg_is_debug(po): return True return False