guix package: Avoid 'exit' calls in 'delete-matching-generations'.
* guix/scripts/package.scm (delete-matching-generations): Remove call to 'exit' when PATTERN is "0". Call 'leave' instead of 'exit' when (null-list? number).master
parent
d26eb84d14
commit
250bc998ac
|
@ -246,7 +246,7 @@ denote ranges as interpreted by 'matching-derivations'."
|
||||||
(delv current (profile-generations profile))))
|
(delv current (profile-generations profile))))
|
||||||
;; Do not delete the zeroth generation.
|
;; Do not delete the zeroth generation.
|
||||||
((equal? 0 (string->number pattern))
|
((equal? 0 (string->number pattern))
|
||||||
(exit 0))
|
#t)
|
||||||
|
|
||||||
;; If PATTERN is a duration, match generations that are
|
;; If PATTERN is a duration, match generations that are
|
||||||
;; older than the specified duration.
|
;; older than the specified duration.
|
||||||
|
@ -261,9 +261,9 @@ denote ranges as interpreted by 'matching-derivations'."
|
||||||
;; Make sure we don't inadvertently remove the current
|
;; Make sure we don't inadvertently remove the current
|
||||||
;; generation.
|
;; generation.
|
||||||
(let ((numbers (delv current numbers)))
|
(let ((numbers (delv current numbers)))
|
||||||
(if (null-list? numbers)
|
(when (null-list? numbers)
|
||||||
(exit 1)
|
(leave (_ "no matching generation~%")))
|
||||||
(delete-generations (%store) profile numbers)))))
|
(delete-generations (%store) profile numbers))))
|
||||||
(else
|
(else
|
||||||
(leave (_ "invalid syntax: ~a~%") pattern)))))
|
(leave (_ "invalid syntax: ~a~%") pattern)))))
|
||||||
|
|
||||||
|
|
Reference in New Issue