mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
import: launchpad: Gracefully handle 404s from api.launchpad.net.
Fixes <https://bugs.gnu.org/49031>. Reported by Emad Alblueshi <emad.albloushi@gmail.com>. * guix/import/launchpad.scm (latest-released-version): Gracefully handle 'json-fetch' returning #f.
This commit is contained in:
parent
bccf2a9e25
commit
f371972e78
1 changed files with 8 additions and 9 deletions
|
@ -110,15 +110,14 @@ (define (pre-release? x)
|
|||
char-set:digit)
|
||||
(assoc-ref x "version"))))
|
||||
|
||||
(assoc-ref
|
||||
(last (remove
|
||||
pre-release?
|
||||
(vector->list
|
||||
(assoc-ref (json-fetch
|
||||
(string-append "https://api.launchpad.net/1.0/"
|
||||
package-name "/releases"))
|
||||
"entries"))))
|
||||
"version"))
|
||||
(match (json-fetch
|
||||
(string-append "https://api.launchpad.net/1.0/"
|
||||
package-name "/releases"))
|
||||
(#f #f) ;404 or similar
|
||||
(json
|
||||
(assoc-ref
|
||||
(last (remove pre-release? (vector->list (assoc-ref json "entries"))))
|
||||
"version"))))
|
||||
|
||||
(define (latest-release pkg)
|
||||
"Return an <upstream-source> for the latest release of PKG."
|
||||
|
|
Loading…
Reference in a new issue