GNU bug report logs - #57515
[PATCH 0/8] Stop unmirroring during updates.

Previous Next

Package: guix-patches;

Reported by: Maxime Devos <maximedevos <at> telenet.be>

Date: Thu, 1 Sep 2022 09:01:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 57515 in the body.
You can then email your comments to 57515 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxime Devos <maximedevos <at> telenet.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 01 Sep 2022 09:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 0/8] Stop unmirroring during updates.
Date: Thu,  1 Sep 2022 11:00:31 +0200
This patch series fixes #57477
(‘"guix refresh -u" sometimes 'unmirrors' source URLs’)
(at least, for the cases that I tested).  The individual commits
have proposals for what packages to test things on.

Due to the new behaviour of 'latest-html-release', a few
simplifications were possible in other updaters.  However,
to keep 57477 fixed, some URLs in (guix download) had to be
switched from http to https.

I'm currently running "make check", not yet completed.

Maxime Devos (8):
  guix: Extract logic of the check-mirror-url.
  gnu-maintenance: Produce mirror:// URIs in latest-ftp-release.
  gnu-maintenance: Produce mirror:// URIs in latest-html-release.
  download: Switch savannah mirrors to HTTPS URLs.
  gnu-maintenance: Simplify latest-savannah-release.
  download: Add a kernel.org mirror.
  gnu-maintenance: Simplify latest-kernel.org-release.
  gnu-maintenance: Remove unused procedures.

 guix/download.scm        | 17 ++++-----
 guix/gnu-maintenance.scm | 74 ++++++++++++++++++++++------------------
 guix/lint.scm            | 23 ++++---------
 3 files changed, 56 insertions(+), 58 deletions(-)


base-commit: 57f8f69562e942557e3331bb81c7e4acd973d189
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:01 GMT) Full text and rfc822 format available.

Message #8 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 2/8] gnu-maintenance: Produce mirror:// URIs in
 latest-ftp-release.
Date: Thu,  1 Sep 2022 11:01:49 +0200
Partially fixes: https://issues.guix.gnu.org/57477.
As a test, try updating gnupg. Before the patch, a ftp:// URL was produced,
now the mirror:// is preserved.

* guix/gnu-maintenance.scm (latest-ftp-release)[file->source]{urls,signature-urls}:
Call uri-mirror-rewrite on the URLs.
---
 guix/gnu-maintenance.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 51e8fcd815..84fd087319 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -363,10 +363,12 @@ (define (file->source directory file)
       (upstream-source
        (package project)
        (version (tarball->version file))
-       (urls (list url))
+       ;; uri-mirror-rewrite: Don't turn nice mirror:// URIs into ftp://
+       ;; URLs during "guix refresh -u".
+       (urls (list (uri-mirror-rewrite url)))
        (signature-urls (match (file->signature url)
                          (#f #f)
-                         (sig (list sig)))))))
+                         (sig (list (uri-mirror-rewrite sig))))))))
 
   (let loop ((directory directory)
              (result    #f))
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:01 GMT) Full text and rfc822 format available.

Message #11 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 3/8] gnu-maintenance: Produce mirror:// URIs in
 latest-html-release.
Date: Thu,  1 Sep 2022 11:01:50 +0200
Partially fixes: https://issues.guix.gnu.org/57477.

TODO: test case, it's http!

I'm not aware of a package using both latest-html-release and mirrors, so it
has not been completely tested.  However, updating "yt-dlp" appears to work
(except for git-fetch not being supported yet).  The expression for the
signature-urls field had to be tweaked to not call uri-mirror-rewrite on #false.

* guix/gnu-maintenance.scm (latest-html-release)[url->research]{urls,signature-urls}:
Call uri-mirror-rewrite on the URLs.
---
 guix/gnu-maintenance.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 84fd087319..2f09539d5d 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -532,9 +532,12 @@ (define (url->release url)
                (upstream-source
                 (package package)
                 (version version)
-                (urls (list url))
+                ;; uri-mirror-rewrite: Don't turn nice mirror:// URIs into ftp://
+                ;; URLs during "guix refresh -u".
+                (urls (list (uri-mirror-rewrite url)))
                 (signature-urls
-                 (list ((or file->signature file->signature/guess) url))))))))
+                 (and=> ((or file->signature file->signature/guess) url)
+                        (lambda (url) (list (uri-mirror-rewrite url))))))))))
 
     (define candidates
       (filter-map url->release links))
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 5/8] gnu-maintenance: Simplify latest-savannah-release.
Date: Thu,  1 Sep 2022 11:01:52 +0200
As latest-html-release now produces mirror:// URIs where possible,
the additional post-processing is not necessary anymore.

As a test, try updating 'gash', the mirror:// URI remains.

* gnu-maintenance.scm (latest-savannah-release): Do not call
adjusted-upstream-source on the result.
---
 guix/gnu-maintenance.scm | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 2f09539d5d..853ad91ea0 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -701,15 +701,12 @@ (define (latest-savannah-release package)
                        ((? string? uri) uri)
                        ((uri mirrors ...) uri))))
          (package   (package-upstream-name package))
-         (directory (dirname (uri-path uri)))
-         (rewrite   (url-prefix-rewrite %savannah-base
-                                        "mirror://savannah")))
+         (directory (dirname (uri-path uri))))
     ;; Note: We use the default 'file->signature', which adds ".sig", ".asc",
     ;; or whichever detached signature naming scheme PACKAGE uses.
-    (and=> (latest-html-release package
-                                #:base-url %savannah-base
-                                #:directory directory)
-           (cut adjusted-upstream-source <> rewrite))))
+    (latest-html-release package
+                         #:base-url %savannah-base
+                         #:directory directory)))
 
 (define (latest-sourceforge-release package)
   "Return the latest release of PACKAGE."
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:02 GMT) Full text and rfc822 format available.

Message #17 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 6/8] download: Add a kernel.org mirror.
Date: Thu,  1 Sep 2022 11:01:53 +0200
Add the mirror from (guix gnu-maintenance) to make the simplified
linux.org updater (of a later commit) work.

* download.scm (%mirrors)[kernel.org]: Add mirrors.edge.kernel.org mirror.
---
 guix/download.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/guix/download.scm b/guix/download.scm
index ac88b215de..29a8f99034 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -138,6 +138,7 @@ (define %mirrors
        "http://kernel.osuosl.org/pub/"
        "http://ftp.be.debian.org/pub/"
        "http://mirror.linux.org.au/"
+       "https://mirrors.edge.kernel.org/pub/"
        "ftp://ftp.funet.fi/pub/mirrors/ftp.kernel.org/pub/")
       (apache             ; from http://www.apache.org/mirrors/dist.html
        "http://www.eu.apache.org/dist/"
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:03 GMT) Full text and rfc822 format available.

Message #20 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 4/8] download: Switch savannah mirrors to HTTPS URLs.
Date: Thu,  1 Sep 2022 11:01:51 +0200
The URI scheme used for nongnu.freemirror.org needs to be consistent
between (guix download) and (guix gnu-maintenance) to make the simplified
savannah-updater (of a later commit) work.  While we're at it, switch the
other mirrors to https as well.

http://download.savannah.gnu.org/releases-noredirect/ is left unmodified
because it 404s

* download.scm (%mirrors)[savannah]: Switch from http to https where possible.
---
 guix/download.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/guix/download.scm b/guix/download.scm
index d459ba8cf1..ac88b215de 100644
--- a/guix/download.scm
+++ b/guix/download.scm
@@ -96,15 +96,15 @@ (define %mirrors
       (hackage
        "http://hackage.haskell.org/")
       (savannah           ; http://download0.savannah.gnu.org/mirmon/savannah/
-       "http://download.savannah.gnu.org/releases/"
-       "http://nongnu.freemirror.org/nongnu/"
-       "http://ftp.cc.uoc.gr/mirrors/nongnu.org/"
-       "http://ftp.twaren.net/Unix/NonGNU/"
-       "http://mirror.csclub.uwaterloo.ca/nongnu/"
-       "http://nongnu.askapache.com/"
-       "http://savannah.c3sl.ufpr.br/"
+       "https://download.savannah.gnu.org/releases/"
+       "https://nongnu.freemirror.org/nongnu/"
+       "https://ftp.cc.uoc.gr/mirrors/nongnu.org/"
+       "http://ftp.twaren.net/Unix/NonGNU/" ; https appears unsupported
+       "https://mirror.csclub.uwaterloo.ca/nongnu/"
+       "https://nongnu.askapache.com/"
+       "https://savannah.c3sl.ufpr.br/"
        "http://download.savannah.gnu.org/releases-noredirect/"
-       "http://download-mirror.savannah.gnu.org/releases/"
+       "https://download-mirror.savannah.gnu.org/releases/"
        "ftp://ftp.twaren.net/Unix/NonGNU/"
        "ftp://mirror.csclub.uwaterloo.ca/nongnu/"
        "ftp://mirror.publicns.net/pub/nongnu/"
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:03 GMT) Full text and rfc822 format available.

Message #23 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 7/8] gnu-maintenance: Simplify latest-kernel.org-release.
Date: Thu,  1 Sep 2022 11:01:54 +0200
As latest-html-release now produces mirror:// URIs where possible,
the additional post-processing is not necessary anymore.

As a test, revert the dtc package back to 1.6.0 and try updating 'gash',
the mirror:// URI remains.

* gnu-maintenance.scm (latest-kernel.org-release): Do not call
adjusted-upstream-source on the result.
---
 guix/gnu-maintenance.scm | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 853ad91ea0..7cb830b849 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -786,14 +786,11 @@ (define (file->signature file)
                        ((? string? uri) uri)
                        ((uri mirrors ...) uri))))
          (package   (package-upstream-name package))
-         (directory (dirname (uri-path uri)))
-         (rewrite   (url-prefix-rewrite %kernel.org-base
-                                        "mirror://kernel.org")))
-    (and=> (latest-html-release package
-                                #:base-url %kernel.org-base
-                                #:directory directory
-                                #:file->signature file->signature)
-           (cut adjusted-upstream-source <> rewrite))))
+         (directory (dirname (uri-path uri))))
+    (latest-html-release package
+                         #:base-url %kernel.org-base
+                         #:directory directory
+                         #:file->signature file->signature)))
 
 (define html-updatable-package?
   ;; Return true if the given package may be handled by the generic HTML
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:03 GMT) Full text and rfc822 format available.

Message #26 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 1/8] guix: Extract logic of the check-mirror-url.
Date: Thu,  1 Sep 2022 11:01:48 +0200
It will be useful for fixing #57477 ‘"guix refresh -u" sometimes 'unmirrors'
source URLs’.

* guix/lint.scm (check-mirror-url): Extract mirror://-constructing code to ...
* guix/gnu-maintenance.scm (uri-mirror-rewrite): ... here, tweaking the API
and implementation in anticipation of future users.
---
 guix/gnu-maintenance.scm | 23 +++++++++++++++++++++++
 guix/lint.scm            | 23 +++++++----------------
 2 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index e7edbf6656..51e8fcd815 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2012, 2013 Nikita Karetnikov <nikita <at> karetnikov.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
+;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,6 +33,8 @@ (define-module (guix gnu-maintenance)
   #:use-module (rnrs io ports)
   #:use-module (system foreign)
   #:use-module ((guix http-client) #:hide (open-socket-for-uri))
+  ;; not required in many cases, so autoloaded to reduce start-up costs.
+  #:autoload   (guix download) (%mirrors)
   #:use-module (guix ftp-client)
   #:use-module (guix utils)
   #:use-module (guix memoization)
@@ -57,6 +60,8 @@ (define-module (guix gnu-maintenance)
             find-package
             gnu-package?
 
+            uri-mirror-rewrite
+
             release-file?
             releases
             latest-release
@@ -651,6 +656,24 @@ (define (url-prefix-rewrite old new)
         (string-append new (string-drop url (string-length old)))
         url)))
 
+(define (uri-mirror-rewrite uri)
+  "Rewrite URI to a mirror:// URI if possible. When not, return URI unmodified."
+  (if (string-prefix? "mirror://" uri)
+      ;; Nothing to do, it's already a mirror URI!
+      uri
+      (let loop ((mirrors %mirrors))
+        (match mirrors
+          (()
+           uri)
+          (((mirror-id mirror-urls ...) rest ...)
+           (match (find (cut string-prefix? <> uri) mirror-urls)
+             (#f
+              (loop rest))
+             (prefix
+              (format #f "mirror://~a/~a"
+                      mirror-id
+                      (string-drop uri (string-length prefix))))))))))
+
 (define (adjusted-upstream-source source rewrite-url)
   "Rewrite URLs in SOURCE by apply REWRITE-URL to each of them."
   (upstream-source
diff --git a/guix/lint.scm b/guix/lint.scm
index edba1c2663..ff7863ab86 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2020 Chris Marusich <cmmarusich <at> gmail.com>
 ;;; Copyright © 2020 Timothy Sample <samplet <at> ngyro.com>
 ;;; Copyright © 2021 Xinglu Chen <public <at> yoctocell.xyz>
-;;; Copyright © 2021 Maxime Devos <maximedevos <at> telenet.be>
+;;; Copyright © 2021, 2022 Maxime Devos <maximedevos <at> telenet.be>
 ;;; Copyright © 2021 Brice Waegeneire <brice <at> waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1223,21 +1223,12 @@ (define (check-source-uri uri)
 (define (check-mirror-url package)
   "Check whether PACKAGE uses source URLs that should be 'mirror://'."
   (define (check-mirror-uri uri)                  ;XXX: could be optimized
-    (let loop ((mirrors %mirrors))
-      (match mirrors
-        (()
-         #f)
-        (((mirror-id mirror-urls ...) rest ...)
-         (match (find (cut string-prefix? <> uri) mirror-urls)
-           (#f
-            (loop rest))
-           (prefix
-            (make-warning package
-                          (G_ "URL should be \
-'mirror://~a/~a'")
-                          (list mirror-id
-                                (string-drop uri (string-length prefix)))
-                          #:field 'source)))))))
+    (define maybe-rewritten-uri (uri-mirror-rewrite uri))
+    (and (not (eq? uri maybe-rewritten-uri))
+         (make-warning package
+                       (G_ "URL should be '~a'")
+                       (list maybe-rewritten-uri)
+                       #:field 'source)))
 
   (let ((origin (package-source package)))
     (if (and (origin? origin)
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:03:04 GMT) Full text and rfc822 format available.

Message #29 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: [PATCH 8/8] gnu-maintenance: Remove unused procedures.
Date: Thu,  1 Sep 2022 11:01:55 +0200
* guix/gnu-maintenance.scm (url-prefix-rewrite, adjusted-upstream-source):
Remove.
---
 guix/gnu-maintenance.scm | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 7cb830b849..2e8b08caa3 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -654,13 +654,6 @@ (define (pure-gnu-package? package)
 (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 (and url (string-prefix? old url))
-        (string-append new (string-drop url (string-length old)))
-        url)))
-
 (define (uri-mirror-rewrite uri)
   "Rewrite URI to a mirror:// URI if possible. When not, return URI unmodified."
   (if (string-prefix? "mirror://" uri)
@@ -679,15 +672,6 @@ (define (uri-mirror-rewrite uri)
                       mirror-id
                       (string-drop uri (string-length prefix))))))))))
 
-(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-base
   ;; One of the Savannah mirrors listed at
   ;; <http://download0.savannah.gnu.org/mirmon/savannah/> that serves valid
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:06:01 GMT) Full text and rfc822 format available.

Message #32 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/8] Stop unmirroring during updates.
Date: Thu, 1 Sep 2022 11:05:10 +0200
[Message part 1 (text/plain, inline)]
> TODO: test case, it's http!
Oops I forgot this TODO, I'll try writing one.

[Message part 2 (text/html, inline)]
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:28:01 GMT) Full text and rfc822 format available.

Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: guix-patches <at> gnu.org
Subject: Re: [PATCH 0/8] Stop unmirroring during updates.
Date: Thu, 1 Sep 2022 11:27:28 +0200
[Message part 1 (text/plain, inline)]
On 01-09-2022 11:00, Maxime Devos wrote:
> This patch series fixes #57477
> (‘"guix refresh -u" sometimes 'unmirrors' source URLs’)
> (at least, for the cases that I tested).  The individual commits
> have proposals for what packages to test things on.
>
> Due to the new behaviour of 'latest-html-release', a few
> simplifications were possible in other updaters.  However,
> to keep 57477 fixed, some URLs in (guix download) had to be
> switched from http to https.
>
> I'm currently running "make check", not yet completed.

A guix-system test fails:

Authenticating channel 'guix', commits 9edb3f6 to a6a1b17 (40.004 new 
commits)...
 [ ]guix system: error: could not authenticate commit 
a6a1b17f29411c44cdda8d0cdf24acd472645140: key C1F3 3EE2 0C52 8FDB 7DD7  
011F 49E3 EE22 1917 25

but this appears unrelated (though TBI I suppose).

Greetings,
Maxime.

[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 09:44:01 GMT) Full text and rfc822 format available.

Message #38 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Cc: Maxime Devos <maximedevos <at> telenet.be>
Subject: [PATCH 9/9] tests/gnu-maintenance: Test latest-html-release.
Date: Thu,  1 Sep 2022 11:43:38 +0200
* tests/gnu-maintenance.scm
("latest-html-release, no signature")
("latest-html-release, signature): Two new tests.
---
 tests/gnu-maintenance.scm | 70 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 69 insertions(+), 1 deletion(-)

diff --git a/tests/gnu-maintenance.scm b/tests/gnu-maintenance.scm
index c04d8ba733..a9e2a0bb9f 100644
--- a/tests/gnu-maintenance.scm
+++ b/tests/gnu-maintenance.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2022 Maxime Devos <maximedevos <at> telenet.be>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -18,9 +19,14 @@
 
 (define-module (test-gnu-maintenance)
   #:use-module (guix gnu-maintenance)
+  #:use-module (guix tests)
+  #:use-module (guix tests http)
+  #:use-module (guix upstream)
+  #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-64)
-  #:use-module (ice-9 match))
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 textual-ports))
 
 (test-begin "gnu-maintenance")
 
@@ -55,4 +61,66 @@ (define-module (test-gnu-maintenance)
              ("mpg321_0.3.2.orig.tar.gz" "0.3.2")
              ("bvi-1.4.1.src.tar.gz" "1.4.1")))))
 
+(test-assert "latest-html-release, no signature"
+  (with-http-server
+      `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\">
+<head>
+<title>Releases!</title>
+</head>
+<body>
+<a href=\"bar/foo-1.tar.gz\">version 1</a>
+<a href=\"bar/foo-2.tar.gz\">version 2</a>
+</body>
+</html>"))
+    (let ()
+      (define package
+        (dummy-package "foo"
+          (source
+           (dummy-origin
+            (uri (string-append (%local-url) "/foo-1.tar.gz"))))
+          (properties
+           `((release-monitoring-url . ,(%local-url))))))
+      (define update ((upstream-updater-latest %generic-html-updater) package))
+      (define expected-new-url
+        (string-append (%local-url) "/foo-2.tar.gz"))
+      (and (pk 'u update)
+           (equal? (upstream-source-version update) "2")
+           (equal? (list expected-new-url)
+                   (upstream-source-urls update))
+           (null? ;; both #false and the empty list are acceptable
+            (or (upstream-source-signature-urls update) '()))))))
+
+(test-assert "latest-html-release, signature"
+  (with-http-server
+      `((200 "<html xmlns=\"http://www.w3.org/1999/xhtml\">
+<head>
+<title>Signed releases!</title>
+</head>
+<body>
+<a href=\"bar/foo-1.tar.gz\">version 1</a>
+<a href=\"bar/foo-2.tar.gz\">version 2</a>
+<a href=\"bar/foo-1.tar.gz.sig\">version 1 signature</a>
+<a href=\"bar/foo-2.tar.gz.sig\">version 2 signature</a>
+</body>
+</html>"))
+    (let ()
+      (define package
+        (dummy-package "foo"
+          (source
+           (dummy-origin
+            (uri (string-append (%local-url) "/foo-1.tar.gz"))))
+          (properties
+           `((release-monitoring-url . ,(%local-url))))))
+      (define update ((upstream-updater-latest %generic-html-updater) package))
+      (define expected-new-url
+        (string-append (%local-url) "/foo-2.tar.gz"))
+      (define expected-signature-url
+        (string-append (%local-url) "/foo-2.tar.gz.sig"))
+      (and (pk 'u update)
+           (equal? (upstream-source-version update) "2")
+           (equal? (list expected-new-url)
+                   (upstream-source-urls update))
+           (equal? (list expected-signature-url)
+                   (upstream-source-signature-urls update))))))
+
 (test-end)
-- 
2.37.2





Information forwarded to guix-patches <at> gnu.org:
bug#57515; Package guix-patches. (Thu, 01 Sep 2022 10:14:02 GMT) Full text and rfc822 format available.

Message #41 received at 57515 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: 57515 <at> debbugs.gnu.org
Subject: Re: [PATCH 0/8] Stop unmirroring during updates.
Date: Thu, 1 Sep 2022 12:13:27 +0200
[Message part 1 (text/plain, inline)]
On 01-09-2022 11:05, Maxime Devos wrote:
>
>> TODO: test case, it's http!
> Oops I forgot this TODO, I'll try writing one.
Done in the 9th patch
[Message part 2 (text/html, inline)]
[OpenPGP_0x49E3EE22191725EE.asc (application/pgp-keys, attachment)]
[OpenPGP_signature (application/pgp-signature, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 26 Sep 2022 20:36:01 GMT) Full text and rfc822 format available.

Notification sent to Maxime Devos <maximedevos <at> telenet.be>:
bug acknowledged by developer. (Mon, 26 Sep 2022 20:36:02 GMT) Full text and rfc822 format available.

Message #46 received at 57515-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 57515-done <at> debbugs.gnu.org
Subject: Re: bug#57515: [PATCH 0/8] Stop unmirroring during updates.
Date: Mon, 26 Sep 2022 22:35:10 +0200
Hi,

Maxime Devos <maximedevos <at> telenet.be> skribis:

>   guix: Extract logic of the check-mirror-url.
>   gnu-maintenance: Produce mirror:// URIs in latest-ftp-release.
>   gnu-maintenance: Produce mirror:// URIs in latest-html-release.
>   download: Switch savannah mirrors to HTTPS URLs.
>   gnu-maintenance: Simplify latest-savannah-release.
>   download: Add a kernel.org mirror.
>   gnu-maintenance: Simplify latest-kernel.org-release.
>   gnu-maintenance: Remove unused procedures.

I applied the whole series, with cosmetic changes on the first patch
and minor tweaks to the commit logs.

Thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 25 Oct 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 176 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.