Fix false positive debuginfor detection

This commit is contained in:
Lubomír Sedlář 2020-03-16 13:29:00 +01:00
parent 0f68f6474f
commit e824989a3e
2 changed files with 39 additions and 1 deletions

34
1366.patch Normal file
View File

@ -0,0 +1,34 @@
From 4a7851416249cd2ccc5b20fdeb7adf581204b254 Mon Sep 17 00:00:00 2001
From: Lubomír Sedlář <lsedlar@redhat.com>
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ář <lsedlar@redhat.com>
---
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(

View File

@ -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ář <lsedlar@redhat.com> - 4.2.1-2
- Fix false positive debuginfo detection
* Fri Mar 13 2020 Lubomír Sedlář <lsedlar@redhat.com> - 4.2.1-1
- New upstream release