guix-commits
[Top][All Lists]
Advanced

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

03/05: gnu-maintenance: Return all the latest tarballs, not just one.


From: Ludovic Courtès
Subject: 03/05: gnu-maintenance: Return all the latest tarballs, not just one.
Date: Mon, 11 Sep 2017 05:58:17 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 1b3ebae4f1b1c1f34a825200440752e6ee8c8a7a
Author: Ludovic Courtès <address@hidden>
Date:   Mon Sep 11 11:45:30 2017 +0200

    gnu-maintenance: Return all the latest tarballs, not just one.
    
    * guix/gnu-maintenance.scm (latest-gnu-release): Return a list of
    matching tarballs instead of just the first one.  This gives us .tar.gz,
    .tar.xz, etc.
---
 guix/gnu-maintenance.scm | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index c903b74..62f8173 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -471,18 +471,30 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
                 (package-upstream-name package)))
     (let* ((files    (ftp.gnu.org-files))
            (relevant (filter (lambda (file)
-                               (and (string-contains file directory)
+                               (and (string-prefix? "/gnu" file)
+                                    (string-contains file directory)
                                     (release-file? name (basename file))))
                              files)))
       (match (sort relevant (lambda (file1 file2)
                               (version>? (sans-extension (basename file1))
                                          (sans-extension (basename file2)))))
-        ((tarball _ ...)
-         (upstream-source
-          (package name)
-          (version (tarball->version tarball))
-          (urls (list (string-append "mirror://gnu/" tarball)))
-          (signature-urls (map (cut string-append <> ".sig") urls))))
+        ((and tarballs (reference _ ...))
+         (let* ((version  (tarball->version reference))
+                (tarballs (filter (lambda (file)
+                                    (string=? (sans-extension
+                                               (basename file))
+                                              (sans-extension
+                                               (basename reference))))
+                                  tarballs)))
+           (upstream-source
+            (package name)
+            (version version)
+            (urls (map (lambda (file)
+                         (string-append "mirror://gnu/"
+                                        (string-drop file
+                                                     (string-length "/gnu/"))))
+                       tarballs))
+            (signature-urls (map (cut string-append <> ".sig") urls)))))
         (()
          #f)))))
 



reply via email to

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