aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-07-20 15:27:54 +0200
committerLudovic Courtès <ludo@gnu.org>2017-07-20 15:29:15 +0200
commit561f4e450078a06c707d3dcda2cf0e7d6eb5ebae (patch)
treefa090c71935ae9cc8fc06c45b2ef1b510b092095
parentedbe07cd67d6050d94fe8ac1af15ab15e857b61d (diff)
downloadgnu-guix-561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.tar
gnu-guix-561f4e450078a06c707d3dcda2cf0e7d6eb5ebae.tar.gz
guix package: '-l' correctly handles zero-generation profiles.
* guix/scripts/package.scm (process-query) <'list-generations>: Properly handle the case where 'profile-generations' returns the empty list.
-rw-r--r--guix/scripts/package.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 96ee5c00ed..8da7a3fd3a 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -713,9 +713,12 @@ processed, #f otherwise."
(raise (condition (&profile-not-found-error
(profile profile)))))
((string-null? pattern)
- (list-generation display-profile-content
- (car (profile-generations profile)))
- (diff-profiles profile (profile-generations profile)))
+ (match (profile-generations profile)
+ (()
+ #t)
+ ((first rest ...)
+ (list-generation display-profile-content first)
+ (diff-profiles profile (cons first rest)))))
((matching-generations pattern profile)
=>
(lambda (numbers)