Skip to content

Commit

Permalink
rpmbuild: introduce --priority option to set the priority of repo
Browse files Browse the repository at this point in the history
  • Loading branch information
nikromen committed May 19, 2023
1 parent 9d63548 commit 68bb81c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rpmbuild/copr_rpmbuild/builders/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def __init__(self, task, sourcedir, resultdir, config):
self.buildroot_pkgs = task.get("buildroot_pkgs")
self.enable_net = task.get("enable_net")
self.repos = task.get("repos")
if task.get("repos") and task.get("priority") is not None:
self.repos["priority"] = task.get("priority")

self.bootstrap = task.get("bootstrap")
self.bootstrap_image = task.get("bootstrap_image")
self.timeout = task.get("timeout", 3600)
Expand Down
6 changes: 6 additions & 0 deletions rpmbuild/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def get_parser():
base_parser.add_argument("--task-url", help="Full URL to a json task definition")
base_parser.add_argument("--task-file", help="Path to a local json file with task definition")

# TODO: better help message
base_parser.add_argument("--priority", type=int, help="Set priority value of this repository")

return base_parser


Expand Down Expand Up @@ -197,6 +200,9 @@ def get_task(args, config, build_config_url_path=None, task_id=None):
if args.copr:
task['task_id'] = copr_chroot_to_task_id(args.copr, args.chroot)

if args.priority:
task["priority"] = args.priority

return task


Expand Down
3 changes: 3 additions & 0 deletions rpmbuild/man/copr-rpmbuild.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ OPTIONS
--verbose::
Print debugging information.

--priority::
Set the priority of this copr repository.

--help::
Display help.

Expand Down

0 comments on commit 68bb81c

Please sign in to comment.