From 1b3ebae4f1b1c1f34a825200440752e6ee8c8a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 11 Sep 2017 11:45:30 +0200 Subject: [PATCH] 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 c903b740ba..62f817347f 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)))))