import: elpa: Updater gracefully handles missing upstream data.

Fixes a crash with:

  guix refresh emacs-exwm-no-x-toolkit

* guix/import/elpa.scm (latest-release): Return #f when
'elpa-package-info' returns #f.
This commit is contained in:
Ludovic Courtès 2021-01-06 18:22:21 +01:00
parent 8d3184c5bc
commit b793718cb4
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016, 2017, 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
;;; Copyright © 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
@ -419,19 +419,24 @@ type '<elpa-package>'."
(string-drop (package-name package) 6)
(package-name package)))
(let* ((repo 'gnu)
(info (elpa-package-info name repo))
(version (match info
((name raw-version . _)
(elpa-version->string raw-version))))
(url (match info
((_ raw-version reqs synopsis kind . rest)
(package-source-url kind name version repo)))))
(upstream-source
(package (package-name package))
(version version)
(urls (list url))
(signature-urls (list (string-append url ".sig"))))))
(define repo 'gnu)
(match (elpa-package-info name repo)
(#f
;; No info, perhaps because PACKAGE is not truly an ELPA package.
#f)
(info
(let* ((version (match info
((name raw-version . _)
(elpa-version->string raw-version))))
(url (match info
((_ raw-version reqs synopsis kind . rest)
(package-source-url kind name version repo)))))
(upstream-source
(package (package-name package))
(version version)
(urls (list url))
(signature-urls (list (string-append url ".sig"))))))))
(define package-from-gnu.org?
(url-predicate (lambda (url)