mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-27 14:52:05 -05:00
import: gnome: Update for Guile-JSON 3.x.
This is a followup to 81c3dc3224
.
* guix/import/gnome.scm (jsonish->upstream-source): Use 'assoc-ref'
instead of 'hash-ref'.
(latest-gnome-release): Match a vector containing an alist, not a hash
table. Use 'fold' instead of 'hash-fold' over RELEASES.
This commit is contained in:
parent
d88b811adf
commit
8d64ef567f
1 changed files with 18 additions and 17 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2017, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
|
@ -46,7 +46,7 @@ (define (jsonish->upstream-source name jsonish)
|
|||
(package name)
|
||||
(version version)
|
||||
(urls (filter-map (lambda (extension)
|
||||
(match (hash-ref dictionary extension)
|
||||
(match (assoc-ref dictionary extension)
|
||||
(#f
|
||||
#f)
|
||||
((? string? relative-url)
|
||||
|
@ -86,21 +86,22 @@ (define upstream-name
|
|||
(json (json->scm port)))
|
||||
(close-port port)
|
||||
(match json
|
||||
((4 (? hash-table? releases) _ ...)
|
||||
(let* ((releases (hash-ref releases upstream-name))
|
||||
(latest (hash-fold (lambda (key value result)
|
||||
(cond ((even-minor-version? key)
|
||||
(match result
|
||||
(#f
|
||||
(cons key value))
|
||||
((newest . _)
|
||||
(if (version>? key newest)
|
||||
(cons key value)
|
||||
result))))
|
||||
(else
|
||||
result)))
|
||||
#f
|
||||
releases)))
|
||||
(#(4 releases _ ...)
|
||||
(let* ((releases (assoc-ref releases upstream-name))
|
||||
(latest (fold (match-lambda*
|
||||
(((key . value) result)
|
||||
(cond ((even-minor-version? key)
|
||||
(match result
|
||||
(#f
|
||||
(cons key value))
|
||||
((newest . _)
|
||||
(if (version>? key newest)
|
||||
(cons key value)
|
||||
result))))
|
||||
(else
|
||||
result))))
|
||||
#f
|
||||
releases)))
|
||||
(and latest
|
||||
(jsonish->upstream-source upstream-name latest))))))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue