summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages.scm10
-rw-r--r--tests/guix-build.sh1
2 files changed, 8 insertions, 3 deletions
diff --git a/gnu/packages.scm b/gnu/packages.scm
index 307f21f057..5a76e9b9ef 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 NAME@VERSION 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 ae75bcfab0..6d4f97019a 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 time@1.7		# PASS, version found
+guix build -n time-1.7		# PASS, deprecated version syntax
 if guix build -n time@3.2;	# FAIL, version not found
 then false; else true; fi
 if guix build -n something-that-will-never-exist; # FAIL