[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
09/11: gnu-maintenance: 'kernel.org' and 'savannah' updaters rewrite URL
From: |
guix-commits |
Subject: |
09/11: gnu-maintenance: 'kernel.org' and 'savannah' updaters rewrite URLs. |
Date: |
Mon, 20 Jul 2020 17:26:13 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 59a47fb67853dd28891376fc970699f11c0f972f
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jul 20 21:26:51 2020 +0200
gnu-maintenance: 'kernel.org' and 'savannah' updaters rewrite URLs.
This makes sure they return 'mirror://' URLs rather that URLs pointing
to the specific mirror they talk to.
* guix/gnu-maintenance.scm (url-prefix-rewrite)
(adjusted-upstream-source): New procedures.
(latest-savannah-release, latest-kernel.org-release): Use it.
---
guix/gnu-maintenance.scm | 41 ++++++++++++++++++++++++++++++++---------
1 file changed, 32 insertions(+), 9 deletions(-)
diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 702848e..2a85504 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -615,6 +615,22 @@ releases are on gnu.org."
(define gnu-hosted?
(url-prefix-predicate "mirror://gnu/"))
+(define (url-prefix-rewrite old new)
+ "Return a one-argument procedure that rewrites URL prefix OLD to NEW."
+ (lambda (url)
+ (if (string-prefix? old url)
+ (string-append new (string-drop url (string-length old)))
+ url)))
+
+(define (adjusted-upstream-source source rewrite-url)
+ "Rewrite URLs in SOURCE by apply REWRITE-URL to each of them."
+ (upstream-source
+ (inherit source)
+ (urls (map rewrite-url (upstream-source-urls source)))
+ (signature-urls (and=> (upstream-source-signature-urls source)
+ (lambda (urls)
+ (map rewrite-url urls))))))
+
(define savannah-package?
(url-prefix-predicate "mirror://savannah/"))
@@ -628,10 +644,13 @@ releases are on gnu.org."
"Return the latest release of PACKAGE."
(let* ((uri (string->uri (origin-uri (package-source package))))
(package (package-upstream-name package))
- (directory (dirname (uri-path uri))))
- (latest-html-release package
- #:base-url %savannah-base
- #:directory directory)))
+ (directory (dirname (uri-path uri)))
+ (rewrite (url-prefix-rewrite %savannah-base
+ "mirror://savannah")))
+ (adjusted-upstream-source (latest-html-release package
+ #:base-url %savannah-base
+ #:directory directory)
+ rewrite)))
(define (latest-xorg-release package)
"Return the latest release of PACKAGE."
@@ -655,11 +674,15 @@ releases are on gnu.org."
(let* ((uri (string->uri (origin-uri (package-source package))))
(package (package-upstream-name package))
- (directory (dirname (uri-path uri))))
- (latest-html-release package
- #:base-url %kernel.org-base
- #:directory directory
- #:file->signature file->signature)))
+ (directory (dirname (uri-path uri)))
+ (rewrite (url-prefix-rewrite %kernel.org-base
+ "mirror://kernel.org")))
+ (adjusted-upstream-source (latest-html-release package
+ #:base-url %kernel.org-base
+ #:directory directory
+ #:file->signature
+ file->signature)
+ rewrite)))
(define %gnu-updater
;; This is for everything at ftp.gnu.org.
- branch master updated (4874cae -> 64066ab), guix-commits, 2020/07/20
- 07/11: download: Add Savannah mirror., guix-commits, 2020/07/20
- 10/11: json: Re-export 'define-json-mapping' from (json) when available., guix-commits, 2020/07/20
- 09/11: gnu-maintenance: 'kernel.org' and 'savannah' updaters rewrite URLs.,
guix-commits <=
- 01/11: gnu: guile-ssh: Update to 0.13.0., guix-commits, 2020/07/20
- 11/11: gnu: python-aionotify: Fix test cases with Python 3.8., guix-commits, 2020/07/20
- 03/11: pack: 'self-contained-tarball' runs derivation in a UTF-8local., guix-commits, 2020/07/20
- 02/11: ssh: Speed up RPCs by using #:nodelay., guix-commits, 2020/07/20
- 05/11: gnu-maintenance: 'latest-html-release' honors #:file->signature., guix-commits, 2020/07/20
- 04/11: pack: Build the store database under a UTF-8 locale., guix-commits, 2020/07/20
- 06/11: gnu-maintenance: Add 'savannah' updater., guix-commits, 2020/07/20
- 08/11: upstream: Use 'warning' instead of 'format'., guix-commits, 2020/07/20