mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
emacs: Gracefully handle wrong package names passed to 'guix-edit'.
Fixes <http://bugs.gnu.org/22933>. * emacs/guix-main.scm (package-location-string): Rewrite to handle the case where 'packages-by-name' returns the empty list. Co-authored-by: Mathieu Lirzin <mthl@gnu.org>
This commit is contained in:
parent
e224495ce1
commit
16f4acbddb
1 changed files with 5 additions and 4 deletions
|
@ -954,10 +954,11 @@ (define (delete-generations* profile generations)
|
|||
|
||||
(define (package-location-string id-or-name)
|
||||
"Return a location string of a package with ID-OR-NAME."
|
||||
(and-let* ((package (or (package-by-id id-or-name)
|
||||
(first (packages-by-name id-or-name))))
|
||||
(location (package-location package)))
|
||||
(location->string location)))
|
||||
(and=> (or (package-by-id id-or-name)
|
||||
(match (packages-by-name id-or-name)
|
||||
(() #f)
|
||||
((package _ ...) package)))
|
||||
(compose location->string package-location)))
|
||||
|
||||
(define (package-source-derivation->store-path derivation)
|
||||
"Return a store path of the package source DERIVATION."
|
||||
|
|
Loading…
Reference in a new issue