[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/12: import: launchpad: Gracefully handle 404s from api.launchpad.net.
From: |
guix-commits |
Subject: |
01/12: import: launchpad: Gracefully handle 404s from api.launchpad.net. |
Date: |
Fri, 18 Jun 2021 08:25:49 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f371972e788df6310e12d15914d70d834c9deadb
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Jun 15 23:18:46 2021 +0200
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.
---
guix/import/launchpad.scm | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index fd3cfa8..a52b39a 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."
- branch master updated (bccf2a9 -> 2ef71b6), guix-commits, 2021/06/18
- 03/12: lint: check-patch-headers: Recognize Git diffs., guix-commits, 2021/06/18
- 01/12: import: launchpad: Gracefully handle 404s from api.launchpad.net.,
guix-commits <=
- 04/12: profiles: Add 'load-profile'., guix-commits, 2021/06/18
- 05/12: profiles: Add "XAUTHORITY" to the precious variables., guix-commits, 2021/06/18
- 02/12: build: Remove Guile 2.2 workaround., guix-commits, 2021/06/18
- 08/12: doc: Explain more reasons for commit revocation., guix-commits, 2021/06/18
- 11/12: gnu: xdg-desktop-portal: Update to 1.8.1 and honor XDG_DESKTOP_PORTAL_DIR., guix-commits, 2021/06/18
- 06/12: doc: Structure the "Commit Access" section., guix-commits, 2021/06/18
- 07/12: doc: Add "Addressing Issues" section., guix-commits, 2021/06/18
- 09/12: doc: Clarify Git commit signing; fix typo., guix-commits, 2021/06/18
- 10/12: gnu: pipewire: Update to 0.3.29., guix-commits, 2021/06/18
- 12/12: gnu: xdg-desktop-portal-wlr: Update to 0.4.0., guix-commits, 2021/06/18