mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 05:57:04 +01:00
substitutes: Build correct narinfo URLs for cache URLs without trailing slash.
Fixes <https://issues.guix.gnu.org/51441>. Reported by Z572 <873216071@qq.com> and Peng Mei Yu <pengmeiyu@riseup.net>. Previously, passing '--substitute-urls=https://mirror.sjtu.edu.cn/guix', without a trailing slash, would fail due to incorrectly constructed narinfo URLs. Users would have to explicitly add a trailing slash. * guix/substitutes.scm (narinfo-request): Ensure BASE has a trailing slash.
This commit is contained in:
parent
4dca1bae27
commit
e68466de12
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,11 @@ (define host
|
|||
|
||||
(define (narinfo-request cache-url path)
|
||||
"Return an HTTP request for the narinfo of PATH at CACHE-URL."
|
||||
(let* ((base (string->uri cache-url))
|
||||
;; Ensure BASE has a trailing slash so that REF is correct regardless of
|
||||
;; whether the user-provided CACHE-URL has a trailing slash.
|
||||
(let* ((base (string->uri (if (string-suffix? "/" cache-url)
|
||||
cache-url
|
||||
(string-append cache-url "/"))))
|
||||
(ref (build-relative-ref
|
||||
#:path (string-append (store-path-hash-part path) ".narinfo")))
|
||||
(url (resolve-uri-reference ref base))
|
||||
|
|
Loading…
Reference in a new issue