1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

Merge pull request #872 from marcus-h/prjresults_name_filter_regex

RFC: Support a regex based name filtering in core.get_prj_results
This commit is contained in:
Marco Strigl 2022-03-31 11:04:29 +02:00 committed by GitHub
commit a9138e54d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5949,6 +5949,9 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
f = show_prj_results_meta(apiurl, prj)
root = ET.fromstring(b''.join(f))
if name_filter is not None:
name_filter = re.compile(name_filter)
pacs = []
# sequence of (repo,arch) tuples
targets = []
@ -6005,12 +6008,12 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
if not name_filter:
pacs_to_show.append(pkg)
targets_to_show.append(repo)
elif name_filter in pkg:
elif name_filter.search(pkg) is not None:
pacs_to_show.append(pkg)
#filtering for Package Name
elif name_filter:
for pkg in pacs:
if name_filter in pkg:
if name_filter.search(pkg) is not None:
pacs_to_show.append(pkg)
#filter non building states