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 <opensource@till.name>
This commit is contained in:
Till Maas 2017-07-26 22:25:47 +02:00
parent 0a3e5b27bf
commit 29bedf2ccc
2 changed files with 5 additions and 8 deletions

View File

@ -66,10 +66,6 @@ def yumlocked(method):
return wrapper return wrapper
def is_debug(po):
return "debuginfo" in po.name or "debugsource" in po.name
def is_source(po): def is_source(po):
if po.arch in ("src", "nosrc"): if po.arch in ("src", "nosrc"):
return True return True
@ -83,7 +79,7 @@ def is_noarch(po):
def is_package(po): def is_package(po):
if is_debug(po): if pungi.util.pkg_is_debug(po):
return False return False
if is_source(po): if is_source(po):
return False return False
@ -444,7 +440,7 @@ class Pungi(PungiBase):
self.sourcerpm_arch_map.setdefault(po.sourcerpm, set()).add(po.arch) self.sourcerpm_arch_map.setdefault(po.sourcerpm, set()).add(po.arch)
def add_debuginfo(self, po, msg=None): 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) raise ValueError("Not a debuginfog package: %s" % po)
if msg: if msg:
self.logger.info(msg) self.logger.info(msg)
@ -1172,7 +1168,7 @@ class Pungi(PungiBase):
added = set() added = set()
for po in self.all_pkgs: for po in self.all_pkgs:
if not is_debug(po): if not pungi.util.pkg_is_debug(po):
continue continue
if po.sourcerpm not in self.sourcerpm_arch_map: if po.sourcerpm not in self.sourcerpm_arch_map:

View File

@ -18,6 +18,7 @@ import fnmatch
import pungi.pathmatch import pungi.pathmatch
import pungi.gather import pungi.gather
import pungi.util
@ -96,7 +97,7 @@ class MultilibMethodBase(object):
raise NotImplementedError raise NotImplementedError
def skip(self, po): 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 True
return False return False