From 9d9b6b5b75b8b796fb4ffa73b7f3d2b04b444ffd Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Tue, 9 May 2023 09:58:00 -0700 Subject: [PATCH] builder: rework OS names for consistency --- builder.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/builder.py b/builder.py index db1e29a..e65e418 100755 --- a/builder.py +++ b/builder.py @@ -22,26 +22,32 @@ RELEASE = os.getenv("FEDORA_RELEASE") if not RELEASE: fail("FEDORA_RELEASE is not defined in your environment, aborting") +TODAY = date.today().strftime("%Y%m%d") + # TODO: should be a class using abc TARGETS = { "kde": { "profile": "Workstation-KDE", - "name": f"Fedora Linux {RELEASE} KDE Plasma", + "name": f"Fedora Linux {RELEASE} with KDE Plasma ({TODAY})", + "os_name": "Fedora Linux with KDE Plasma", "id": "kde", }, "gnome": { "profile": "Workstation-GNOME", - "name": f"Fedora Linux {RELEASE} GNOME", + "name": f"Fedora Linux {RELEASE} with GNOME ({TODAY})", + "os_name": "Fedora Linux with GNOME", "id": "gnome", }, "server": { "profile": "Server", - "name": f"Fedora Linux {RELEASE} Server", + "name": f"Fedora Linux {RELEASE} Server ({TODAY})", + "os_name": "Fedora Linux Server", "id": "server", }, "minimal": { "profile": "Minimal", - "name": f"Fedora Linux {RELEASE} Minimal", + "name": f"Fedora Linux {RELEASE} Minimal ({TODAY})", + "os_name": "Fedora Linux Minimal", "id": "minimal", }, } @@ -114,15 +120,14 @@ def kiwiBuild(profile): def packageBuild(target): # TODO: rewrite in python instead of shelling out runCommand(["./make-asahi-installer-package.sh"]) - today = date.today().strftime("%Y%m%d") - package = f"fedora-{RELEASE}-{target['id']}-{today}.zip" - os.rename(f"fedora-{RELEASE}-{today}.zip", package) + package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip" + os.rename(f"fedora-{RELEASE}-{TODAY}.zip", package) with open("installer_data.json", "r") as f: data = json.load(f) - data["os_list"][0]["name"] = f"{target['name']} ({today})" - data["os_list"][0]["default_os_name"] = target["name"] + data["os_list"][0]["name"] = target["name"] + data["os_list"][0]["default_os_name"] = target["os_name"] data["os_list"][0]["package"] = package with open("installer_data.json", "w") as f: @@ -148,8 +153,7 @@ def invalidateCF(path): def packageUpload(target): - today = date.today().strftime("%Y%m%d") - package = f"fedora-{RELEASE}-{target['id']}-{today}.zip" + package = f"fedora-{RELEASE}-{target['id']}-{TODAY}.zip" uploadToS3(package, f"os/{package}")