From e77a676f21fd1fcd38717a8a02ffcf0005e0552d Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 12 Mar 2025 21:00:25 +0900 Subject: [PATCH] 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 --- guix/gnu-maintenance.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 555fd9e8cdd..7f7fafd5696 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?)