guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/04: import: elpa: Updater gracefully handles missing upstream data.


From: guix-commits
Subject: 01/04: import: elpa: Updater gracefully handles missing upstream data.
Date: Thu, 7 Jan 2021 06:09:50 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit b793718cb482a2d2c9fb3de1c90baaf388a0eef5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Jan 6 18:22:21 2021 +0100

    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.
---
 guix/import/elpa.scm | 33 +++++++++++++++++++--------------
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm
index 1d586ac..c0dc5ac 100644
--- a/guix/import/elpa.scm
+++ b/guix/import/elpa.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]