[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH koji] Allow untracked packages in the buildroot

When using koji to build a local repository, it is often unwanted to
import the >4000 packages of Fedora 6/7. Although direct support for this
mode is missing, it is easy to add it (e.g. I use a wrapper around mock
which generates a new configuration with additional repositories).

Unfortunately, koji will refuse to build packages because buildroot
contains untracked packages. This patch makes koji ignore such packages.

Signed-off-by: Enrico Scholz <enrico scholz informatik tu-chemnitz de>
 hub/kojihub.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/hub/kojihub.py b/hub/kojihub.py
index 2830ad1..a3bbe5f 100644
--- a/hub/kojihub.py
+++ b/hub/kojihub.py
@@ -5565,7 +5565,12 @@ class BuildRoot(object):
         VALUES (%(brootid)s,%(rpm_id)s,%(update)s)"""
         rpm_ids = []
         for an_rpm in rpmlist:
-            rpm_id = get_rpm(an_rpm, strict=True)['id']
+            rpm_id = get_rpm(an_rpm, strict=False)
+	    if rpm_id == None:
+		#ignore unknown packages (e.g. from untracked repositories)
+		continue
+	    rpm_id = rpm_id['id']
             if update and current.has_key(rpm_id):
                 #ignore duplicate packages for updates

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]