guix-commits
[Top][All Lists]
Advanced

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

branch master updated: import: gnu: Fix the detection of non-GNU package


From: guix-commits
Subject: branch master updated: import: gnu: Fix the detection of non-GNU packages.
Date: Tue, 02 Feb 2021 13:49:06 -0500

This is an automated email from the git hooks/post-receive script.

apteryx pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 889f425  import: gnu: Fix the detection of non-GNU packages.
889f425 is described below

commit 889f425b35290240e618d851d492453c4fc36b62
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Tue Feb 2 13:45:59 2021 -0500

    import: gnu: Fix the detection of non-GNU packages.
    
    * guix/import/gnu.scm (gnu->guix-package): Move the 'find-package' call 
before
    the 'latest-release' call, which would fail when the package did not have an
    entry on the FTP server.
---
 guix/import/gnu.scm | 27 +++++++++++++--------------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm
index c26faff..51d5b77 100644
--- a/guix/import/gnu.scm
+++ b/guix/import/gnu.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -111,19 +112,17 @@ download policy (see 'download-tarball' for details.)"
   "Return the package declaration for NAME as an s-expression.  Use
 KEY-DOWNLOAD as the OpenPGP key download policy (see 'download-tarball' for
 details.)"
-  (match (latest-release name)
-    ((? upstream-source? release)
-     (let ((version (upstream-source-version release)))
-       (match (find-package name)
-         (#f
-          (raise (formatted-message
-                  (G_ "couldn't find meta-data for GNU ~a")
-                  name)))
-         (info
-          (gnu-package->sexp info release #:key-download key-download)))))
-    (_
-     (raise (formatted-message
-             (G_ "failed to determine latest release of GNU ~a")
-             name)))))
+  (let ((package (find-package name)))
+    (unless package
+      (raise (formatted-message (G_ "no GNU package found for ~a") name)))
+
+    (match (latest-release name)
+      ((? upstream-source? release)
+       (let ((version (upstream-source-version release)))
+         (gnu-package->sexp package release #:key-download key-download)))
+      (_
+       (raise (formatted-message
+               (G_ "failed to determine latest release of GNU ~a")
+               name))))))
 
 ;;; gnu.scm ends here



reply via email to

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