diff options
authorPeter Wu <>2019-10-20 16:47:15 +0100
committerPeter Wu <>2019-10-20 16:47:15 +0100
commitdf3e5c893d0f4d02e99a3d2f171e3d98817d5266 (patch)
parent91616baae2b271eeb551ceec0333c92d6294cf79 (diff)
downloadscripts-df3e5c893d0f4d02e99a3d2f171e3d98817d5266.tar.gz support zstd compressed packages
"The imminent release of pacman 5.2 brings build tools with support for compressing packages with zstd. [..] If you use custom scripts make sure these do not rely on hardcoded file extensions. The zstd package file extension will be .pkg.tar.zst."
1 files changed, 4 insertions, 2 deletions
diff --git a/ b/
index a8f5fd0..1ce6fa8 100755
--- a/
+++ b/
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# Arch Linux packages proxy
-# Proxies requests, caching files with ".pkg.tar.xz" suffix.
+# Proxies requests, caching files with ".pkg.tar.*" suffix.
# If the cached file exists, serve that file.
# Otherwise, try to download file (as normally) and optionally cache it with
# ".download" extension. If the file exists and the file is not being
@@ -241,7 +241,9 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
def is_cacheable(self):
"""Whether the requested file should be cached."""
- return self.path.endswith(".pkg.tar.xz")
+ # Support .pkg.tar.xz, .pkg.tar.zst, etc.
+ basename = os.path.splitext(self.path)[0]
+ return basename.endswith(".pkg.tar")
def is_date_sensitive_request(self):
"""Whether the resource is ephemeral."""