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)))
(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)))))