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(