[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/15: substitutes: Build correct narinfo URLs for cache URLs without tr
From: |
guix-commits |
Subject: |
03/15: substitutes: Build correct narinfo URLs for cache URLs without trailing slash. |
Date: |
Sat, 11 Dec 2021 18:29:27 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit e68466de122d94ac3fa75aae234cd5fd89482a5a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Dec 11 23:22:47 2021 +0100
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.
---
guix/substitutes.scm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/guix/substitutes.scm b/guix/substitutes.scm
index a5c554a..9014cf6 100644
--- a/guix/substitutes.scm
+++ b/guix/substitutes.scm
@@ -156,7 +156,11 @@ indicates that PATH is unavailable at CACHE-URL."
(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))
- branch master updated (d5cfca2 -> 8bb6c74), guix-commits, 2021/12/11
- 01/15: challenge: Use SRFI-71 instead of SRFI-11., guix-commits, 2021/12/11
- 02/15: challenge: Store item contents are returned in canonical order., guix-commits, 2021/12/11
- 03/15: substitutes: Build correct narinfo URLs for cache URLs without trailing slash.,
guix-commits <=
- 05/15: gnu: Add ascii., guix-commits, 2021/12/11
- 07/15: gnu: python-vcrpy: Update to 4.1.1., guix-commits, 2021/12/11
- 04/15: narinfo: Do not repeat slash when building nar URLs., guix-commits, 2021/12/11
- 08/15: gnu: python-aws-sam-translator: Update to 1.40.0., guix-commits, 2021/12/11
- 06/15: gnu: Add python-ipaddress., guix-commits, 2021/12/11
- 09/15: gnu: python-cfn-lint: Update to 0.54.3., guix-commits, 2021/12/11
- 10/15: gnu: python-cfn-lint: Honor #:tests? flag., guix-commits, 2021/12/11
- 12/15: gnu: python-s3transfer: Honor #:tests? flag., guix-commits, 2021/12/11
- 13/15: gnu: Update awscli, python-boto3 and python-botocore., guix-commits, 2021/12/11
- 11/15: gnu: python-s3transfer: Update to 0.5.0., guix-commits, 2021/12/11