From c55b2f23ca1d8d1cf1abbe507bb15a92ce8297ce Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Aug 28 2024 19:12:47 +0000 Subject: Fix Bodhi release discovery to handle Branched and Rawhide In Bodhi, the releases that represent Branched and Rawhide have state 'pending', not 'active'. Also, the release that represents Rawhide has the appropriate release number (currently 42) as its version, not 'rawhide' or 'Rawhide'. The rest of this app is written to expect that this script will treat Rawhide's version as 'rawhide' (and thus name the database files as `fedora-rawhide_(type).sqlite`), so let's detect when we've hit the Bodhi release that matches Rawhide by checking the 'branch' property, and handle it specially. See: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/2SFM5ZKYWEGETYS2GVUZP3ABEUH34Y6H/ Signed-off-by: Adam Williamson --- diff --git a/bin/fetch-repository-dbs.py b/bin/fetch-repository-dbs.py index fe438f7..e7d53a5 100755 --- a/bin/fetch-repository-dbs.py +++ b/bin/fetch-repository-dbs.py @@ -381,8 +381,11 @@ def main(): active_releases = [] for release in r_json["releases"]: - if release["state"] == "current": - active_releases.append((release["id_prefix"], release["version"])) + if release["state"] in ("current", "pending"): + if release["branch"] == "rawhide": + active_releases.append((release["id_prefix"], release["branch"])) + else: + active_releases.append((release["id_prefix"], release["version"])) # Generate repository URLs. for (product, version) in active_releases: diff --git a/bin/get-product-names.py b/bin/get-product-names.py index be41058..74a13d5 100755 --- a/bin/get-product-names.py +++ b/bin/get-product-names.py @@ -26,7 +26,10 @@ def get_data(URI, page=1, previous_data=None): if result["id_prefix"] == "FEDORA-EPEL": formatted_data["epel-" + result["version"]] = get_name(result["long_name"]) elif result["id_prefix"] == "FEDORA": - formatted_data["fedora-" + result["version"]] = get_name(result["long_name"]) + if result["branch"] == "rawhide": + formatted_data["fedora-rawhide"] = "Fedora Rawhide" + else: + formatted_data["fedora-" + result["version"]] = get_name(result["long_name"]) # Recurise function to do pagination if raw_data["page"] != raw_data["pages"]: