diff options
-rw-r--r-- | guix/import/launchpad.scm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index fd3cfa8444..a52b39a085 100644 --- a/guix/import/launchpad.scm +++ b/guix/import/launchpad.scm @@ -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." |