From 10cce4466528548c570d0b5ea328cc188d607295 Mon Sep 17 00:00:00 2001 From: Max Lin Date: Wed, 23 Feb 2022 00:40:38 +0800 Subject: [PATCH] skippkg_finder: fix unconditional matches if the first regex element is space In case regex list has not been defined any value, the first element will be space only, this causes unconditional matched any binary name. Exit the for loop if the first element is space only. --- skippkg-finder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/skippkg-finder.py b/skippkg-finder.py index 2108e270..c9bd2805 100755 --- a/skippkg-finder.py +++ b/skippkg-finder.py @@ -313,6 +313,9 @@ class SkippkgFinder(object): obsoleted.remove(pkg) for regex in self.skiplist_supplement_regex: + # exit if it has no regex defined + if not regex: + break for binary in fullbinarylist: result = re.match(regex, binary) if result and binary not in obsoleted and\