From 1e2b89bec0dc912c94fb2841d847ab344cbb6b90 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Tue, 1 Oct 2024 11:19:34 +1000 Subject: [PATCH] added options to tag2distrepo --- plugins/tag2distrepo/tag2distrepo.py | 46 ++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/plugins/tag2distrepo/tag2distrepo.py b/plugins/tag2distrepo/tag2distrepo.py index 20c8da6..c394838 100644 --- a/plugins/tag2distrepo/tag2distrepo.py +++ b/plugins/tag2distrepo/tag2distrepo.py @@ -21,6 +21,13 @@ def tag2distrepo(cbtype, tag, build, user, force=False): raise ValueError("Tag %s has no arches configured but tag2distrepo is enabled" % tag['name']) keys = tag['extra'].get("tag2distrepo.keys", '').split() + compfile = tag['extra'].get("tag2distrepo.comp", 'none') + inherit = tag['extra'].get("tag2distrepo.inherit", False) + latest = tag['extra'].get("tag2distrepo.latest", False) + split_debuginfo = tag['extra'].get("tag2distrepo.split_debuginfo", False) + skip_missing = False + if tag['extra'].get("tag2distrepo.skip_missing_signatures"): + skip_missing = True if keys: logger.debug("Ensuring signed RPMs are written out") @@ -30,18 +37,33 @@ def tag2distrepo(cbtype, tag, build, user, force=False): if rpm['sigkey'] == key: write_signed_rpm(rpm['id'], key, False) - task_opts = { - 'arch': tag['arches'].split(), - 'comp': None, - 'delta': [], - 'event': None, - 'inherit': False, - 'latest': False, - 'multilib': False, - 'split_debuginfo': False, - 'skip_missing_signatures': False, - 'allow_missing_signatures': not keys, - } + if tag['extra'].get("tag2distrepo.allow_missing_signatures"): + task_opts = { + 'arch': tag['arches'].split(), + 'comp': compfile, + 'delta': [], + 'event': None, + 'inherit': inherit, + 'latest': latest, + 'multilib': False, + 'split_debuginfo': split_debuginfo, + 'skip_missing_signatures': skip_missing, + 'allow_missing_signatures': True, + } + else: + task_opts = { + 'arch': tag['arches'].split(), + 'comp': compfile, + 'delta': [], + 'event': None, + 'inherit': inherit, + 'latest': latest, + 'multilib': False, + 'split_debuginfo': split_debuginfo, + 'skip_missing_signatures': skip_missing, + 'allow_missing_signatures': not keys, + } + logging.debug( "Scheduling distRepo for tag %s, keys %s", tag['name'],