[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: gnu-maintenance: 'generic-html' computes the right source URL.
From: |
guix-commits |
Subject: |
02/04: gnu-maintenance: 'generic-html' computes the right source URL. |
Date: |
Thu, 3 Jun 2021 07:07:50 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 1e8ebb16c997eeeb65ef1205e930dcce0f0e0345
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Jun 3 12:58:41 2021 +0200
gnu-maintenance: 'generic-html' computes the right source URL.
Fixes a regression introduced in
84f8bae0f85de081bbc55aa54ad6a50981a06a43, whereby the URL computed for
the new ffmpeg (for instance) would be:
https://ffmpeg.org/ffmpeg-4.4.tar.xz
instead of:
https://ffmpeg.org/releases/ffmpeg-4.4.tar.xz
Reported by Maxim Cournoyer.
* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Adjust
computation in the case of a URI-reference with a relative path.
---
guix/gnu-maintenance.scm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 19cf106..e7edbf6 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -507,12 +507,19 @@ are unavailable."
#:port (uri-port uri)
#:path url))))
- ;; URL is relative path and BASE-URL may or may not
+ ;; URL is a relative path and BASE-URL may or may not
;; end in slash.
((string-suffix? "/" base-url)
(string-append base-url url))
(else
- (string-append (dirname base-url) "/" url)))))
+ ;; If DIRECTORY is non-empty, assume BASE-URL
+ ;; denotes a directory; otherwise, assume BASE-URL
+ ;; denotes a file within a directory, and that URL
+ ;; is relative to that directory.
+ (string-append (if (string-null? directory)
+ (dirname base-url)
+ base-url)
+ "/" url)))))
(and (release-file? package base)
(let ((version (tarball->version base)))
(upstream-source