guix-commits
[Top][All Lists]
Advanced

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

01/01: upstream: Use first url when it lacks an extension.


From: David Craven
Subject: 01/01: upstream: Use first url when it lacks an extension.
Date: Wed, 14 Dec 2016 13:21:18 +0000 (UTC)

dvc pushed a commit to branch master
in repository guix.

commit af72a21a698bce94f4526fe04c0a9a06c6c3da80
Author: Ludovic Courtès <address@hidden>
Date:   Wed Sep 28 16:17:07 2016 +0200

    upstream: Use first url when it lacks an extension.
    
    * guix/upstream.scm (package-update): Use a url from the list when it
      lacks an extension.
---
 guix/upstream.scm |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/guix/upstream.scm b/guix/upstream.scm
index 8685afd..2218731 100644
--- a/guix/upstream.scm
+++ b/guix/upstream.scm
@@ -241,12 +241,16 @@ and 'interactive' (default)."
                    ((archive-type)
                     (match (and=> (package-source package) origin-uri)
                       ((? string? uri)
-                       (or (file-extension uri) "gz"))
+                       (file-extension uri))
                       (_
                        "gz")))
                    ((url signature-url)
                     (find2 (lambda (url sig-url)
-                             (string-suffix? archive-type url))
+                             ;; Some URIs lack a file extension, like
+                             ;; 'https://crates.io/???/0.1/download'.  In that
+                             ;; case, pick the first URL.
+                             (or (not archive-type)
+                                 (string-suffix? archive-type url)))
                            urls
                            (or signature-urls (circular-list #f)))))
        (let ((tarball (download-tarball store url signature-url



reply via email to

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