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.
This commit is contained in:
Max Lin 2022-02-23 00:40:38 +08:00
parent 31e0087399
commit 10cce44665

View File

@ -313,6 +313,9 @@ class SkippkgFinder(object):
obsoleted.remove(pkg) obsoleted.remove(pkg)
for regex in self.skiplist_supplement_regex: for regex in self.skiplist_supplement_regex:
# exit if it has no regex defined
if not regex:
break
for binary in fullbinarylist: for binary in fullbinarylist:
result = re.match(regex, binary) result = re.match(regex, binary)
if result and binary not in obsoleted and\ if result and binary not in obsoleted and\