guix package: Fix search path lookup when an obsolete version is installed.

Before that, 'guix package --search-paths' would not work if, say,
'foo-0.2' is installed but the distro provides 'foo-0.3'.

* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Handle the case where 'find-best-packages-by-name' returns '().
This commit is contained in:
Ludovic Courtès 2014-08-31 22:17:56 +02:00
parent ab3893d713
commit 4720f524fc

View file

@ -305,10 +305,12 @@ (define manifest-entry->package
;; Use 'find-best-packages-by-name' and not 'find-packages-by-name';
;; the former traverses the module tree only once and then allows for
;; efficient access via a vhash.
(match (or (find-best-packages-by-name name version)
(find-best-packages-by-name name #f))
(match (find-best-packages-by-name name version)
((p _ ...) p)
(_ #f)))))
(_
(match (find-best-packages-by-name name #f)
((p _ ...) p)
(_ #f)))))))
(define search-path-definition
(match-lambda