From f5ae834233051d9cb1ea571746a47cd7a69b9a19 Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Jul 26 2019 18:45:24 +0000 Subject: Use package.cfg for epel8+ branches Signed-off-by: Mohan Boddu --- diff --git a/fedpkg/utils.py b/fedpkg/utils.py index ea25439..13b3225 100644 --- a/fedpkg/utils.py +++ b/fedpkg/utils.py @@ -350,11 +350,33 @@ def get_stream_branches(server_url, package_name): # Please remember to review the data regularly, there are only stream # branches, or some new replacement of PDC fixes the issue as well, it # should be ok to remove if from this list. - return [ - item for item in branches - if not re.match(r'^(f|el|epel)\d+$', item['name']) and - item['name'] != 'master' - ] + stream_branches = [] + for item in branches: + if item['name'] == 'master': + continue + elif re.match(r'^(f|el)\d+$', item['name']): + continue + # epel8 and above should be considered a stream branch to use + # package.cfg file in the branch. + elif re.match(r'^(epel)\d+$', item['name']): + epel_version = None + match = re.match(r'^epel(?P\d+)$', item['name']) + if match: + epel_version = int(match.groupdict()["epel_version"]) + # If the branch is epel8, add it to stream branches + if epel_version >= 8: + stream_branches.append(item) + else: + continue + # epel8-playground and above playground branches should be considered + # as release branches so that it will use epelx-playground-candidate + # target to build. + elif bool(re.match(r'^epel\d+-playground$', item['name'])): + continue + else: + stream_branches.append(item) + return stream_branches + def expand_release(rel, active_releases): @@ -379,5 +401,9 @@ def expand_release(rel, active_releases): return active_releases['epel'] elif rel in active_releases['fedora'] or rel in active_releases['epel']: return [rel] + # if epelx-playground branch then return the release to use + # epelx-playground-candidate target + elif re.match(r'^(epel)\d+-playground$', rel): + return [rel] else: return None