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.master
parent
bccf2a9e25
commit
f371972e78
|
@ -110,15 +110,14 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
|
|||
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."
|
||||
|
|
Reference in New Issue