mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-03 21:36:15 +01:00
Merge branch 'add_package_filter' of https://github.com/lethliel/osc
Add --target-package-filter option to do_request.
This commit is contained in:
commit
1524214060
@ -2029,6 +2029,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='exclude target project from request list')
|
help='exclude target project from request list')
|
||||||
@cmdln.option('--involved-projects', action='store_true',
|
@cmdln.option('--involved-projects', action='store_true',
|
||||||
help='show all requests for project/packages where USER is involved')
|
help='show all requests for project/packages where USER is involved')
|
||||||
|
@cmdln.option('--target-package-filter', metavar='TARGET_PACKAGE_FILTER',
|
||||||
|
help='only list requests for the packages matching the package filter. A (python) regular expression is expected.')
|
||||||
@cmdln.option('--source-buildstatus', action='store_true',
|
@cmdln.option('--source-buildstatus', action='store_true',
|
||||||
help='print the buildstatus of the source package (only works with "show" and the interactive review)')
|
help='print the buildstatus of the source package (only works with "show" and the interactive review)')
|
||||||
@cmdln.alias("rq")
|
@cmdln.alias("rq")
|
||||||
@ -2312,7 +2314,19 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
## Workaround: fetch all, and filter on client side.
|
## Workaround: fetch all, and filter on client side.
|
||||||
|
|
||||||
## FIXME: date filtering should become implemented on server side
|
## FIXME: date filtering should become implemented on server side
|
||||||
|
|
||||||
|
|
||||||
|
if opts.target_package_filter:
|
||||||
|
filter_pattern = re.compile(opts.target_package_filter)
|
||||||
for result in results:
|
for result in results:
|
||||||
|
filtered = False
|
||||||
|
for action in result.actions:
|
||||||
|
if action.type == 'group' or not opts.target_package_filter:
|
||||||
|
continue
|
||||||
|
if not filter_pattern.match(action.tgt_package):
|
||||||
|
filtered = True
|
||||||
|
break
|
||||||
|
if not filtered:
|
||||||
if days == 0 or result.state.when > since or result.state.name == 'new':
|
if days == 0 or result.state.when > since or result.state.name == 'new':
|
||||||
if (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
if (opts.interactive or conf.config['request_show_interactive']) and not opts.non_interactive:
|
||||||
ignore_reviews = subcmd != 'review'
|
ignore_reviews = subcmd != 'review'
|
||||||
|
Loading…
Reference in New Issue
Block a user