[zap] Fix zap architecture in URLs.
Recently zap added archtecture to URLs so they became
things like `linux-x64.zip` instead of just `linux.zip`.
Changes:
- fix the architecture bit in fetch.py
- add andreilitvin to the OWNERS since I am familiar with
zap and its usage and now I know where the code resides
- add support for `mac-arm64` since this seems supported now
Change-Id: Id13f1cd485b8bb2dc335f1d2d267c415fcbb30ad
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/3pp/+/857797
Reviewed-by: Rob Mohr <mohrr@google.com>
Commit-Queue: Andrei Litvin <andreilitvin@google.com>
diff --git a/zap/3pp.pb b/zap/3pp.pb
index 644900f..cdc5a06 100644
--- a/zap/3pp.pb
+++ b/zap/3pp.pb
@@ -1,5 +1,5 @@
create {
- platform_re: "linux-amd64|mac-amd64|mac-arm64|windows-amd64"
+ platform_re: "linux-arm64|linux-amd64|mac-amd64|mac-arm64|windows-amd64"
source {
script { name: "fetch.py" }
unpack_archive: true
diff --git a/zap/OWNERS b/zap/OWNERS
index 68efc83..f73a0c3 100644
--- a/zap/OWNERS
+++ b/zap/OWNERS
@@ -1 +1,2 @@
+andreilitvin@google.com
tpudlik@google.com
diff --git a/zap/fetch.py b/zap/fetch.py
index 2edc5f6..770cb42 100644
--- a/zap/fetch.py
+++ b/zap/fetch.py
@@ -28,10 +28,6 @@
def do_latest():
"""Retrieve current version.
-
- It would be overly complicated to get the latest version, so we just use a
- fixed version. When a new version is released the line at the top will need
- to be updated.
"""
if _ZAP_VERSION == ZapVersion.RELEASE:
print(
@@ -56,15 +52,15 @@
def get_download_url(version, platform):
"""Get URL of the given version and platform."""
- platform_part = {
- "linux-amd64": "linux",
- "mac-amd64": "mac",
- # Due to Rosetta, the Mac build will work on Mac on Arm as well.
- "mac-arm64": "mac",
- "windows-amd64": "win",
+ platform_name = {
+ "linux-amd64": "linux-x64",
+ "linux-arm64": "linux-arm64",
+ "mac-amd64": "mac-x64",
+ "mac-arm64": "mac-arm64",
+ "windows-amd64": "win-x64",
}[platform]
- url = _URL.format(version=version, platform=platform_part)
+ url = _URL.format(version=version, platform=platform_name)
manifest = {"url": [url], "ext": ".zip"}
print(json.dumps(manifest))