summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-03-12 21:00:25 +0900
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2025-03-12 21:32:04 +0900
commite77a676f21fd1fcd38717a8a02ffcf0005e0552d (patch)
tree9d056bd359a5882e7aa880c08c698db1187f9b8f
parent9449ab3c2025820d2e6fd679fa7e34832b667ea7 (diff)
gnu-maintenance: Better fix for 'guix refresh --update'.
The previous fix introduced in commit 8176277487 ("import: Avoid duplicate trailing '/' in computed import URL.") regressed on the handling of *file* source URIs: $ guix refresh cairo --update Starting download of /tmp/guix-file.xUKazf From https://cairographics.org/cairo-1.18.4.tar.xz... download failed "https://cairographics.org/cairo-1.18.4.tar.xz" 404 "Not Found" * guix/gnu-maintenance.scm (import-html-release): Revert commit 8176277487, instead adding a trailing slash only if it doesn't already exist. Change-Id: I6e3889f14badd8843bbf6436ad62a1594f553afe
-rw-r--r--guix/gnu-maintenance.scm8
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 555fd9e8cd..7f7fafd569 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -677,7 +677,13 @@ also updated to the latest version, as explained in the doc of the
\"rewrite-url\" procedure used."
(let* ((current-version (package-version package))
(name (package-upstream-name package))
- (url (canonicalize-url directory base-url))
+ (url (if (string-null? directory)
+ base-url
+ (string-append base-url directory
+ ;; Ensure URL ends with a trailing slash.
+ (if (string-suffix? "/" directory)
+ ""
+ "/"))))
(url (if rewrite-url?
(rewrite-url url current-version #:to-version version
#:partial-version? partial-version?)