diff options
Diffstat (limited to 'guix/scripts/package.scm')
-rw-r--r-- | guix/scripts/package.scm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 1d00e39540..1f21890fcd 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -977,11 +977,16 @@ more information.~%")) (leave (_ "profile '~a' does not exist~%") profile)) ((string-null? pattern) - (for-each list-generation - (generation-numbers profile))) + (let ((numbers (generation-numbers profile))) + (if (equal? numbers '(0)) + (exit 1) + (for-each list-generation numbers)))) ((matching-generations pattern profile) => - (cut for-each list-generation <>)) + (lambda (numbers) + (if (null-list? numbers) + (exit 1) + (for-each list-generation numbers)))) (else (leave (_ "invalid syntax: ~a~%") pattern))) |