From 08ecc339804ce78f52a3f523d2e344c221d61b9c Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Feb 03 2021 19:17:44 +0000 Subject: [PATCH 1/2] don't assume that the hub will report arches for external repos Fixes https://pagure.io/koji/issue/2681 --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 8cb0e14..8b15979 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -4937,7 +4937,10 @@ def anon_handle_taginfo(goptions, session, args): if external_repos: print("External repos:") for rinfo in external_repos: - if not rinfo['arches']: + if 'arches' not in rinfo: + # older hubs will not return this field + rinfo['arches'] = '-' + elif not rinfo['arches']: rinfo['arches'] = 'inherited from tag' # TODO else intersection of arches? print(" %(priority)3i %(external_repo_name)s " From e8b56972b3e5551163869db731eb50fddab9c65d Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Feb 03 2021 19:32:26 +0000 Subject: [PATCH 2/2] make builder code similarly tolerant --- diff --git a/builder/kojid b/builder/kojid index 513f8dc..f8786da 100755 --- a/builder/kojid +++ b/builder/kojid @@ -5553,7 +5553,7 @@ class CreaterepoTask(BaseTaskHandler): # generate repo url list, starting with our local premerge repo repos = ['file://' + localdir + '/'] for repo in external_repos: - if repo['arches'] and arch not in repo['arches'].split(): + if repo.get('arches') and arch not in repo['arches'].split(): # ignore external repo with non-relevant archlist continue ext_url = repo['url']