Use only one list of patterns/rules for debug packages
Signed-off-by: Till Maas <opensource@till.name>
This commit is contained in:
parent
938531e2b2
commit
b26547ae77
@ -24,9 +24,7 @@ import pungi.common
|
||||
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"]
|
||||
from pungi.util import DEBUG_PATTERNS
|
||||
|
||||
|
||||
def get_source_name(pkg):
|
||||
@ -123,7 +121,7 @@ class GatherBase(object):
|
||||
q_multilib = q.difference(q_native).union(q_noarch).apply()
|
||||
|
||||
# debug packages
|
||||
self.q_debug_packages = q.filter(name__glob=DEBUG_GLOBS).apply()
|
||||
self.q_debug_packages = q.filter(name__glob=DEBUG_PATTERNS).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)
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
# along with this program; if not, see <https://gnu.org/licenses/>.
|
||||
|
||||
|
||||
import fnmatch
|
||||
import subprocess
|
||||
import os
|
||||
import shutil
|
||||
@ -33,6 +34,8 @@ import functools
|
||||
from kobo.shortcuts import run, force_list
|
||||
from productmd.common import get_major_version
|
||||
|
||||
# Patterns that match all names of debuginfo packages
|
||||
DEBUG_PATTERNS = ["*-debuginfo", "*-debuginfo-*", "*-debugsource"]
|
||||
|
||||
def _doRunCommand(command, logger, rundir='/tmp', output=subprocess.PIPE, error=subprocess.PIPE, env=None):
|
||||
"""Run a command and log the output. Error out if we get something on stderr"""
|
||||
@ -190,14 +193,17 @@ def pkg_is_srpm(pkg_obj):
|
||||
def pkg_is_debug(pkg_obj):
|
||||
if pkg_is_srpm(pkg_obj):
|
||||
return False
|
||||
|
||||
if isinstance(pkg_obj, str):
|
||||
# string
|
||||
if "-debuginfo" in pkg_obj or '-debugsource' in pkg_obj:
|
||||
return True
|
||||
name = pkg_obj
|
||||
else:
|
||||
# package object
|
||||
if "-debuginfo" in pkg_obj.name or '-debugsource' in pkg_obj.name:
|
||||
name = pkg_obj.name
|
||||
|
||||
for pattern in DEBUG_PATTERNS:
|
||||
if fnmatch.fnmatch(name, pattern):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user