Blob Blame History Raw
From 1fb7dd4717d8f45406a9effe51a9b2f28764a25c Mon Sep 17 00:00:00 2001
From: clime <clime@redhat.com>
Date: Wed, 31 Oct 2018 20:24:43 +0100
Subject: [PATCH] [rpmbuild] support ,priority= appendix for a repo url and
 interpret it as dnf repo priority

---
 rpmbuild/main.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/main.py b/main.py
index 22f3e422..0f1af989 100755
--- a/main.py
+++ b/main.py
@@ -219,6 +219,13 @@ def get_task(args, config, build_config_url_path=None, task_id=None):
         task['repos'] = get_additional_repo_configs(
             task['additional_repos'], args.chroot, config.get('main', 'backend_url'))
 
+    if task.get('repos'):
+        for i in range(len(task['repos'])):
+            match = re.match('(.*),priority=([0-9]+)$', task['repos'][i]['url'])
+            if match:
+                task['repos'][i]['url'] = match.group(1)
+                task['repos'][i]['priority'] = match.group(2)
+
     return task
 
 
-- 
2.17.0