From e824989a3ea5c8a48498673a645b2af1236a251f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 16 Mar 2020 13:29:00 +0100 Subject: [PATCH] Fix false positive debuginfor detection --- 1366.patch | 34 ++++++++++++++++++++++++++++++++++ pungi.spec | 6 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 1366.patch diff --git a/1366.patch b/1366.patch new file mode 100644 index 00000000..f81ae9f5 --- /dev/null +++ b/1366.patch @@ -0,0 +1,34 @@ +From 4a7851416249cd2ccc5b20fdeb7adf581204b254 Mon Sep 17 00:00:00 2001 +From: Lubomír Sedlář +Date: Mar 16 2020 10:13:02 +0000 +Subject: util: Fix regex for detecting debuginfo packages + + +The `re.match` function already anchors the pattern at the start of the +string, but allows for other characters to continue after match. + +This is causing problems with packages like `elfutils-debuginfod-client` +which are not debuginfo. + +Let's be safe and explicitly anchor both start and end. + +Signed-off-by: Lubomír Sedlář + +--- + +diff --git a/pungi/util.py b/pungi/util.py +index 21bb0bb..9810899 100644 +--- a/pungi/util.py ++++ b/pungi/util.py +@@ -37,7 +37,9 @@ from productmd.common import get_major_version + + # Patterns that match all names of debuginfo packages + DEBUG_PATTERNS = ["*-debuginfo", "*-debuginfo-*", "*-debugsource"] +-DEBUG_PATTERN_RE = re.compile(r".*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource") ++DEBUG_PATTERN_RE = re.compile( ++ r"^(?:.*-debuginfo(?:-.*)?|.*-debuginfo-.*|.*-debugsource)$" ++) + + + def _doRunCommand( + diff --git a/pungi.spec b/pungi.spec index 557b0c1f..7ce24f97 100644 --- a/pungi.spec +++ b/pungi.spec @@ -2,12 +2,13 @@ Name: pungi Version: 4.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: https://pagure.io/pungi/pull-request/1366.patch BuildRequires: python3-nose BuildRequires: python3-mock @@ -141,6 +142,9 @@ nosetests-3 --exe %{_bindir}/%{name}-wait-for-signed-ostree-handler %changelog +* Mon Mar 16 2020 Lubomír Sedlář - 4.2.1-2 +- Fix false positive debuginfo detection + * Fri Mar 13 2020 Lubomír Sedlář - 4.2.1-1 - New upstream release