[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/06: guix package: Avoid 'exit' calls in 'delete-matching-generations'
From: |
Ludovic Courtès |
Subject: |
05/06: guix package: Avoid 'exit' calls in 'delete-matching-generations'. |
Date: |
Mon, 06 Apr 2015 19:56:11 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 250bc998ac9d456f70c675579020d7173f87f3c3
Author: Ludovic Courtès <address@hidden>
Date: Mon Apr 6 21:27:03 2015 +0200
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).
---
guix/scripts/package.scm | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 3a7afb7..6190f32 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -246,7 +246,7 @@ denote ranges as interpreted by 'matching-derivations'."
(delv current (profile-generations profile))))
;; Do not delete the zeroth generation.
((equal? 0 (string->number pattern))
- (exit 0))
+ #t)
;; If PATTERN is a duration, match generations that are
;; 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
;; generation.
(let ((numbers (delv current numbers)))
- (if (null-list? numbers)
- (exit 1)
- (delete-generations (%store) profile numbers)))))
+ (when (null-list? numbers)
+ (leave (_ "no matching generation~%")))
+ (delete-generations (%store) profile numbers))))
(else
(leave (_ "invalid syntax: ~a~%") pattern)))))
- branch master updated (d507b27 -> 57b8623), Ludovic Courtès, 2015/04/06
- 01/06: guix package: Move generation deletion to its own procedure., Ludovic Courtès, 2015/04/06
- 02/06: gnu: lsof: Add mirrors., Ludovic Courtès, 2015/04/06
- 03/06: tests: Deal with 'mount-points' not returning "/"., Ludovic Courtès, 2015/04/06
- 04/06: guix package: Never remove the current generation and warn about it., Ludovic Courtès, 2015/04/06
- 05/06: guix package: Avoid 'exit' calls in 'delete-matching-generations'.,
Ludovic Courtès <=
- 06/06: tests: Move 'guix package' tests that require networking to a separate file., Ludovic Courtès, 2015/04/06