guix-commits
[Top][All Lists]
Advanced

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

02/03: packages: Support the deprecated "NAME-VERSION" syntax.


From: Ludovic Courtès
Subject: 02/03: packages: Support the deprecated "NAME-VERSION" syntax.
Date: Tue, 08 Mar 2016 10:51:54 +0000

civodul pushed a commit to branch master
in repository guix.

commit 95cd4971d07fe312a4e0d21b72e7bf1bba493753
Author: Ludovic Courtès <address@hidden>
Date:   Tue Mar 8 11:38:46 2016 +0100

    packages: Support the deprecated "NAME-VERSION" syntax.
    
    Fixes a typo introduced in 1b846da8c372bee78851439fd9e72b2499115e5a that
    would lead to a backtrace when using the deprecated syntax.
    
    * gnu/packages.scm (%find-package): Turn the first argument to
    'call-with-values' into a thunk.  Use #:select instead of '@' to select
    the right 'package-name->name+version' procedure.
---
 gnu/packages.scm    |   10 +++++++---
 tests/guix-build.sh |    1 +
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages.scm b/gnu/packages.scm
index 307f21f..5a76e9b 100644
--- a/gnu/packages.scm
+++ b/gnu/packages.scm
@@ -24,6 +24,9 @@
   #:use-module (guix packages)
   #:use-module (guix ui)
   #:use-module (guix utils)
+  #:use-module ((guix build utils)
+                #:select ((package-name->name+version
+                           . hyphen-separated-name->name+version)))
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 vlist)
   #:use-module (ice-9 match)
@@ -300,9 +303,10 @@ use address@hidden instead~%")))
          (or fallback?
              ;; XXX: Fallback to the older specification style with an hyphen
              ;; between NAME and VERSION, for backward compatibility.
-             (let ((proc (@ (guix build utils) package-name->name+version)))
-               (call-with-values (proc name)
-                 (cut %find-package spec <> <> #:fallback? #t)))
+             (call-with-values
+                 (lambda ()
+                   (hyphen-separated-name->name+version name))
+               (cut %find-package spec <> <> #:fallback? #t))
              (leave (_ "~A: unknown package~%") name))))))
 
 (define (specification->package spec)
diff --git a/tests/guix-build.sh b/tests/guix-build.sh
index ae75bcf..6d4f970 100644
--- a/tests/guix-build.sh
+++ b/tests/guix-build.sh
@@ -171,6 +171,7 @@ then false; else true; fi
 # Parsing package names and versions.
 guix build -n time             # PASS
 guix build -n address@hidden           # PASS, version found
+guix build -n time-1.7         # PASS, deprecated version syntax
 if guix build -n address@hidden;       # FAIL, version not found
 then false; else true; fi
 if guix build -n something-that-will-never-exist; # FAIL



reply via email to

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