mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 15:36:20 -05:00
guix: import: stackage: Fix JSON accessors.
* guix/import/stackage.scm (lts-info-ghc-version, lst-info-packages): Use assoc-ref for accessing parsed JSON.
This commit is contained in:
parent
bb6419f374
commit
127586adfb
1 changed files with 4 additions and 7 deletions
|
@ -43,15 +43,12 @@ (define %stackage-url "http://www.stackage.org")
|
|||
|
||||
(define (lts-info-ghc-version lts-info)
|
||||
"Retruns the version of the GHC compiler contained in LTS-INFO."
|
||||
(match lts-info
|
||||
((("snapshot" ("ghc" . version) _ _) _) version)
|
||||
(_ #f)))
|
||||
(and=> (assoc-ref lts-info "snapshot")
|
||||
(cut assoc-ref <> "ghc")))
|
||||
|
||||
(define (lts-info-packages lts-info)
|
||||
"Returns the alist of packages contained in LTS-INFO."
|
||||
(match lts-info
|
||||
((("packages" pkg ...) . _) pkg)
|
||||
(_ '())))
|
||||
"Retruns the alist of packages contained in LTS-INFO."
|
||||
(or (assoc-ref lts-info "packages") '()))
|
||||
|
||||
(define (leave-with-message fmt . args)
|
||||
(raise (condition (&message (message (apply format #f fmt args))))))
|
||||
|
|
Loading…
Reference in a new issue