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.
This commit is contained in:
Ludovic Courtès 2017-09-11 11:45:30 +02:00
parent e9f3811390
commit 1b3ebae4f1
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 19 additions and 7 deletions

View File

@ -471,18 +471,30 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
(package-upstream-name package))) (package-upstream-name package)))
(let* ((files (ftp.gnu.org-files)) (let* ((files (ftp.gnu.org-files))
(relevant (filter (lambda (file) (relevant (filter (lambda (file)
(and (string-contains file directory) (and (string-prefix? "/gnu" file)
(string-contains file directory)
(release-file? name (basename file)))) (release-file? name (basename file))))
files))) files)))
(match (sort relevant (lambda (file1 file2) (match (sort relevant (lambda (file1 file2)
(version>? (sans-extension (basename file1)) (version>? (sans-extension (basename file1))
(sans-extension (basename file2))))) (sans-extension (basename file2)))))
((tarball _ ...) ((and tarballs (reference _ ...))
(upstream-source (let* ((version (tarball->version reference))
(package name) (tarballs (filter (lambda (file)
(version (tarball->version tarball)) (string=? (sans-extension
(urls (list (string-append "mirror://gnu/" tarball))) (basename file))
(signature-urls (map (cut string-append <> ".sig") urls)))) (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))))) #f)))))