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.
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."