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
This commit is contained in:
Maxim Cournoyer 2025-03-12 21:00:25 +09:00
parent 9449ab3c20
commit e77a676f21
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -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?)