packages: Remove support for PACKAGE-VERSION deprecated syntax.
This syntax had been deprecated since 2016-02-28. * gnu/packages.scm (%find-package): Remove #:fallback? parameter and handling. * tests/guix-build.sh: Remove test for "time-1.7" syntax. * doc/guix.texi (Invoking guix lint): Update 'guix lint' output in example.
This commit is contained in:
		
							parent
							
								
									6d1a5e5ffd
								
							
						
					
					
						commit
						e30c2be10d
					
				
					 3 changed files with 5 additions and 19 deletions
				
			
		| 
						 | 
					@ -16281,9 +16281,9 @@ distribution:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@smallexample
 | 
					@smallexample
 | 
				
			||||||
$ guix lint -c cve
 | 
					$ guix lint -c cve
 | 
				
			||||||
gnu/packages/base.scm:652:2: glibc-2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547
 | 
					gnu/packages/base.scm:652:2: glibc@@2.21: probably vulnerable to CVE-2015-1781, CVE-2015-7547
 | 
				
			||||||
gnu/packages/gcc.scm:334:2: gcc-4.9.3: probably vulnerable to CVE-2015-5276
 | 
					gnu/packages/gcc.scm:334:2: gcc@@4.9.3: probably vulnerable to CVE-2015-5276
 | 
				
			||||||
gnu/packages/image.scm:312:2: openjpeg-2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924
 | 
					gnu/packages/image.scm:312:2: openjpeg@@2.1.0: probably vulnerable to CVE-2016-1923, CVE-2016-1924
 | 
				
			||||||
@dots{}
 | 
					@dots{}
 | 
				
			||||||
@end smallexample
 | 
					@end smallexample
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -306,7 +306,7 @@ return its return value."
 | 
				
			||||||
;;; Package specification.
 | 
					;;; Package specification.
 | 
				
			||||||
;;;
 | 
					;;;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define* (%find-package spec name version #:key fallback?)
 | 
					(define* (%find-package spec name version)
 | 
				
			||||||
  (match (find-best-packages-by-name name version)
 | 
					  (match (find-best-packages-by-name name version)
 | 
				
			||||||
    ((pkg . pkg*)
 | 
					    ((pkg . pkg*)
 | 
				
			||||||
     (unless (null? pkg*)
 | 
					     (unless (null? pkg*)
 | 
				
			||||||
| 
						 | 
					@ -314,10 +314,6 @@ return its return value."
 | 
				
			||||||
       (warning (_ "choosing ~a@~a from ~a~%")
 | 
					       (warning (_ "choosing ~a@~a from ~a~%")
 | 
				
			||||||
                (package-name pkg) (package-version pkg)
 | 
					                (package-name pkg) (package-version pkg)
 | 
				
			||||||
                (location->string (package-location pkg))))
 | 
					                (location->string (package-location pkg))))
 | 
				
			||||||
     (when fallback?
 | 
					 | 
				
			||||||
       (warning (_ "deprecated NAME-VERSION syntax; \
 | 
					 | 
				
			||||||
use NAME@VERSION instead~%")))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
     (match (package-superseded pkg)
 | 
					     (match (package-superseded pkg)
 | 
				
			||||||
       ((? package? new)
 | 
					       ((? package? new)
 | 
				
			||||||
        (info (_ "package '~a' has been superseded by '~a'~%")
 | 
					        (info (_ "package '~a' has been superseded by '~a'~%")
 | 
				
			||||||
| 
						 | 
					@ -328,16 +324,7 @@ use NAME@VERSION instead~%")))
 | 
				
			||||||
    (x
 | 
					    (x
 | 
				
			||||||
     (if version
 | 
					     (if version
 | 
				
			||||||
         (leave (_ "~A: package not found for version ~a~%") name version)
 | 
					         (leave (_ "~A: package not found for version ~a~%") name version)
 | 
				
			||||||
         (if (not fallback?)
 | 
					         (leave (_ "~A: unknown package~%") name)))))
 | 
				
			||||||
             ;; XXX: Fallback to the older specification style with an hyphen
 | 
					 | 
				
			||||||
             ;; between NAME and VERSION, for backward compatibility.
 | 
					 | 
				
			||||||
             (call-with-values
 | 
					 | 
				
			||||||
                 (lambda ()
 | 
					 | 
				
			||||||
                   (hyphen-separated-name->name+version name))
 | 
					 | 
				
			||||||
               (cut %find-package spec <> <> #:fallback? #t))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
             ;; The fallback case didn't find anything either, so bail out.
 | 
					 | 
				
			||||||
             (leave (_ "~A: unknown package~%") name))))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define (specification->package spec)
 | 
					(define (specification->package spec)
 | 
				
			||||||
  "Return a package matching SPEC.  SPEC may be a package name, or a package
 | 
					  "Return a package matching SPEC.  SPEC may be a package name, or a package
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -185,7 +185,6 @@ test "`guix build superseded -d`" = "`guix build bar -d`"
 | 
				
			||||||
# Parsing package names and versions.
 | 
					# Parsing package names and versions.
 | 
				
			||||||
guix build -n time		# PASS
 | 
					guix build -n time		# PASS
 | 
				
			||||||
guix build -n time@1.7		# PASS, version found
 | 
					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
 | 
					if guix build -n time@3.2;	# FAIL, version not found
 | 
				
			||||||
then false; else true; fi
 | 
					then false; else true; fi
 | 
				
			||||||
if guix build -n something-that-will-never-exist; # FAIL
 | 
					if guix build -n something-that-will-never-exist; # FAIL
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue