From fdfa60c6080db6da60c83ea512ecb49085d18a3a Mon Sep 17 00:00:00 2001 From: Marco Strigl Date: Wed, 12 Jun 2024 20:57:56 +0200 Subject: [PATCH] add architecture filtering to osc release --- osc/_private/api_source.py | 4 ++++ osc/_private/common.py | 3 +++ osc/commandline.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/osc/_private/api_source.py b/osc/_private/api_source.py index 0be6fbde14..ee493e74ee 100644 --- a/osc/_private/api_source.py +++ b/osc/_private/api_source.py @@ -89,6 +89,7 @@ def release( project, package, repository, + architecture, target_project, target_repository, set_release_to=None, @@ -102,6 +103,7 @@ def release( target_project, target_package=None, repository=repository, + architecture=architecture, dest_repository=target_repository, delayed=delayed, ) @@ -114,6 +116,8 @@ def release( url_query = {"cmd": "release"} if repository: url_query["repository"] = repository + if architecture: + url_query["arch"] = architecture if target_project: url_query["target_project"] = target_project if target_repository: diff --git a/osc/_private/common.py b/osc/_private/common.py index a27efb342a..93203d6835 100644 --- a/osc/_private/common.py +++ b/osc/_private/common.py @@ -34,6 +34,9 @@ def format_msg_project_package_options( if dest_repository: msg += f" repository '{dest_repository}'" + if dest_repository: + msg += f" architecture '{architecture}'" + msg_options = [key.replace("_", "-") for key, value in options.items() if value] if msg_options: msg_options.sort() diff --git a/osc/commandline.py b/osc/commandline.py index 0bc7dc6312..b6cc79222c 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3922,6 +3922,8 @@ def do_copypac(self, subcmd, opts, *args): keep_link=opts.keep_link) print(decode_it(r)) + @cmdln.option('-a', '--arch', metavar='ARCH', + help='Release only binaries from the specified architecture') @cmdln.option('-r', '--repo', metavar='REPO', help='Release only binaries from the specified repository') @cmdln.option('--target-project', metavar='TARGETPROJECT', @@ -3954,6 +3956,7 @@ def do_release(self, subcmd, opts, *args): project=project, package=package, repository=opts.repo, + architecture=opts.arch, target_project=opts.target_project, target_repository=opts.target_repository, set_release_to=opts.set_release,