From e992d82f7d88e4cf3a9ed5479ebb4b8c0170b90d Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 14 Dec 2023 10:27:42 +0100 Subject: [PATCH] unify download filenames (#6487) refs https://github.com/mitmproxy/www/issues/57 --- release/build.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/release/build.py b/release/build.py index 9d6bdf6da..2a2e69a23 100755 --- a/release/build.py +++ b/release/build.py @@ -89,17 +89,25 @@ def version() -> str: def operating_system() -> str: - match (platform.system(), platform.machine()): - case ("Windows", _): - return "windows" - case ("Linux", _): - return "linux" - case ("Darwin", "x86_64"): - return "macos-x86_64" - case ("Darwin", "arm64"): - return "macos-arm64" - warnings.warn("Unexpected platform.") - return f"{platform.system()}-{platform.machine()}" + match platform.system(): + case "Windows": + system = "windows" + case "Linux": + system = "linux" + case "Darwin": + system = "macos" + case other: + warnings.warn("Unexpected system.") + system = other + match platform.machine(): + case "AMD64" | "x86_64": + machine = "x86_64" + case "arm64": + machine = "arm64" + case other: + warnings.warn("Unexpected platform.") + machine = other + return f"{system}-{machine}" def _pyinstaller(specfile: str) -> None: @@ -350,6 +358,11 @@ def installbuilder_installer(): installer = DIST_DIR / f"mitmproxy-{version()}-windows-x64-installer.exe" assert installer.exists() + # unify filenames + installer = installer.rename( + installer.with_name(installer.name.replace("x64", "x86_64")) + ) + print("Run installer...") subprocess.run( [installer, "--mode", "unattended", "--unattendedmodeui", "none"], check=True