[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/12: gnu-maintenance: 'generic-html' correctly handles relative releas
From: |
guix-commits |
Subject: |
09/12: gnu-maintenance: 'generic-html' correctly handles relative release URLs. |
Date: |
Fri, 28 May 2021 17:05:12 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 84f8bae0f85de081bbc55aa54ad6a50981a06a43
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri May 28 22:56:38 2021 +0200
gnu-maintenance: 'generic-html' correctly handles relative release URLs.
* guix/gnu-maintenance.scm (latest-html-release)[url->release]: Fix
source URL construction in cases where URL is a possibly relative path.
---
guix/gnu-maintenance.scm | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 4e3a54d..19cf106 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -496,9 +496,23 @@ are unavailable."
(define (url->release url)
(let* ((base (basename url))
- (url (if (string=? base url)
- (string-append base-url directory "/" url)
- url)))
+ (base-url (string-append base-url directory))
+ (url (cond ((and=> (string->uri url) uri-scheme) ;full URL?
+ url)
+ ((string-prefix? "/" url) ;absolute path?
+ (let ((uri (string->uri base-url)))
+ (uri->string
+ (build-uri (uri-scheme uri)
+ #:host (uri-host uri)
+ #:port (uri-port uri)
+ #:path url))))
+
+ ;; URL is 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)))))
(and (release-file? package base)
(let ((version (tarball->version base)))
(upstream-source
- branch master updated (b1ae0f3 -> cefa260), guix-commits, 2021/05/28
- 01/12: guix package: Do not warn about "missing arguments" when there's nothing to do., guix-commits, 2021/05/28
- 09/12: gnu-maintenance: 'generic-html' correctly handles relative release URLs.,
guix-commits <=
- 03/12: guix build: Emit "nothing to do" warning only when needed., guix-commits, 2021/05/28
- 12/12: gnu: xjobs: Add 'release-monitoring-url' property., guix-commits, 2021/05/28
- 07/12: gnu: Add hostscope., guix-commits, 2021/05/28
- 10/12: gnu: hostscope: Add 'release-monitoring-url' property., guix-commits, 2021/05/28
- 02/12: doc: Spell out the implications of disabling substitutes., guix-commits, 2021/05/28
- 06/12: gnu: Add mbuffer., guix-commits, 2021/05/28
- 11/12: gnu: Add xjobs., guix-commits, 2021/05/28
- 08/12: gnu-maintenance: 'release-file?' accepts 'v' prefix as in "PKG-v1.2.tgz"., guix-commits, 2021/05/28
- 05/12: gnu: ipopt: Update to 3.13.4, guix-commits, 2021/05/28
- 04/12: gnu: Add cbc., guix-commits, 2021/05/28