From d92390b80bba15d8071c3f4cda869c492ec95de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 26 Jul 2017 10:29:27 +0200 Subject: [PATCH] Add support for debugsource packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These packages should behave like regular debuginfo packages (at least for now). Fixes: https://pagure.io/pungi/issue/684 Signed-off-by: Lubomír Sedlář --- pungi/gather.py | 4 +--- pungi/gather_dnf.py | 5 ++++- pungi/util.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pungi/gather.py b/pungi/gather.py index 048336b6..8d77c757 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -67,9 +67,7 @@ def yumlocked(method): def is_debug(po): - if "debuginfo" in po.name: - return True - return False + return "debuginfo" in po.name or "debugsource" in po.name def is_source(po): diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index 1b030be8..2d31645c 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -25,6 +25,9 @@ import pungi.dnf_wrapper import pungi.multilib_dnf from pungi.profiler import Profiler +# Globs for package name that should match all debuginfo packages +DEBUG_GLOBS = ["*-debuginfo", "*-debuginfo-*", "*-debugsource", "*-debugsource-*"] + def get_source_name(pkg): # Workaround for rhbz#1418298 @@ -120,7 +123,7 @@ class GatherBase(object): q_multilib = q.difference(q_native).union(q_noarch).apply() # debug packages - self.q_debug_packages = q.filter(name__glob=["*-debuginfo", "*-debuginfo-*"]).apply() + self.q_debug_packages = q.filter(name__glob=DEBUG_GLOBS).apply() self.q_native_debug_packages = self.q_debug_packages.intersection(q_native) self.q_multilib_debug_packages = self.q_debug_packages.intersection(q_multilib) diff --git a/pungi/util.py b/pungi/util.py index 40d38305..60086002 100644 --- a/pungi/util.py +++ b/pungi/util.py @@ -192,11 +192,11 @@ def pkg_is_debug(pkg_obj): return False if isinstance(pkg_obj, str): # string - if "-debuginfo" in pkg_obj: + if "-debuginfo" in pkg_obj or '-debugsource' in pkg_obj: return True else: # package object - if "-debuginfo" in pkg_obj.name: + if "-debuginfo" in pkg_obj.name or '-debugsource' in pkg_obj.name: return True return False