diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-07-20 15:27:54 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-07-20 15:29:15 +0200 |
commit | 561f4e450078a06c707d3dcda2cf0e7d6eb5ebae (patch) | |
tree | fa090c71935ae9cc8fc06c45b2ef1b510b092095 /guix | |
parent | edbe07cd67d6050d94fe8ac1af15ab15e857b61d (diff) |
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.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/scripts/package.scm | 9 |
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) |