Verified Commit cb7ac5c3 authored by Florian Pritz's avatar Florian Pritz
Browse files

archive: Fix redirect for packages with hyphen in pkgname

should redirect to

but it actually redirects to the URL with the "-etc" part missing from
the directory name. The new regex fixes this by removing the part where
pkgver is allowed to have a hyphen. The PKGBUILD manpage explains that
pkgver is explicitly not allowed to contain a hyphen so we do not need
to allow this either.

It also makes the regex more readable by using named groups for the
different parts.

Signed-off-by: Florian Pritz's avatarFlorian Pritz <>
parent 5b06d2e3
......@@ -33,8 +33,7 @@ server {
location ~ /repos/201[3456]/.*/.*\.pkg\.tar\.xz(\.sig)? {
# Tricky regexp to separate the pkgname from the pkgver (both can contain "-")
rewrite ^/repos/.*/((.*?)-[^-/]+-[0-9]+-[^-]+.*\.pkg\.tar\.xz(\.sig)?)$ /$2/$1 last;
rewrite ^/repos/.*/((?<pkgname>[^/]+)-(?<pkgver>[^-/]+)-(?<pkgrel>[0-9]+)-(?<arch>[^-/]+)\.pkg\.tar\.xz(?<sig>\.sig)?)$ /$2/$1 last;
# download URLs look like:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment