guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

35/40: gnu-maintenance: Do not crash on refresh when origin URI is a lis


From: guix-commits
Subject: 35/40: gnu-maintenance: Do not crash on refresh when origin URI is a list.
Date: Tue, 5 Sep 2023 20:02:24 -0400 (EDT)

apteryx pushed a commit to branch master
in repository guix.

commit fd09e7b053c7e5dd24e5fb1b3cb9b2cc95a8bf7c
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Sep 5 14:14:02 2023 -0400

    gnu-maintenance: Do not crash on refresh when origin URI is a list.
    
    Updating the simh package would fail with:
    
      ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure
      string-prefix?: Wrong type argument in position 2 (expecting
      string): ("http://simh.trailing-edge.com/sources/simhv312-4.zip";
      "http://simh.trailing-edge.com/sources/archive/simhv312-4.zip";)
    
    This is because it expects a scalar value, but lists are allowed for URIs.
    
    * guix/gnu-maintenance.scm (import-html-updatable-release): Check that URI 
is
    a string before checking if it has the mirror:// prefix.
---
 guix/gnu-maintenance.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index ee6e0db747..41e0f4443d 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -980,7 +980,8 @@ the directory containing its source tarball.  Optionally 
include a VERSION
 string to fetch a specific version."
   (let* ((uri       (string->uri
                      (match (origin-uri (package-source package))
-                       ((? (cut string-prefix? "mirror://" <>) url)
+                       ((and (? string?)
+                             (? (cut string-prefix? "mirror://" <>) url))
                         ;; Retrieve the authoritative HTTP URL from a mirror.
                         (http-url? url))
                        ((? string? url) url)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]