summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-09-28 21:45:46 +0200
committerLudovic Courtès <ludo@gnu.org>2015-09-28 22:54:04 +0200
commit30d9aa54229b413e52a2ed00032fa5179e4905ec (patch)
tree6500ff2e778f18e96a39c570a8a859e93f859d5d /guix
parent16748d80158875ae4cd54270be683fcf9c5d5169 (diff)
guix gc: Add '--list-failures' and '--clear-failures'.
Suggested by Mark H Weaver <mhw@netris.org>. * guix/scripts/gc.scm (show-help, %options): Add --list-failures and --clear-failures. (guix-gc): Honor them. * doc/guix.texi (Invoking guix gc): Document them. (Invoking guix-daemon): Mention them.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/gc.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/guix/scripts/gc.scm b/guix/scripts/gc.scm
index 7e06c72ccb..89a68d51d0 100644
--- a/guix/scripts/gc.scm
+++ b/guix/scripts/gc.scm
@@ -62,6 +62,10 @@ Invoke the garbage collector.\n"))
--verify[=OPTS] verify the integrity of the store; OPTS is a
comma-separated combination of 'repair' and
'contents'"))
+ (display (_ "
+ --list-failures list cached build failures"))
+ (display (_ "
+ --clear-failures remove PATHS from the set of cached failures"))
(newline)
(display (_ "
-h, --help display this help and exit"))
@@ -130,6 +134,14 @@ Invoke the garbage collector.\n"))
(option '("referrers") #f #f
(lambda (opt name arg result)
(alist-cons 'action 'list-referrers
+ (alist-delete 'action result))))
+ (option '("list-failures") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'action 'list-failures
+ (alist-delete 'action result))))
+ (option '("clear-failures") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'action 'clear-failures
(alist-delete 'action result))))))
@@ -200,6 +212,11 @@ Invoke the garbage collector.\n"))
(verify-store store
#:check-contents? (memq 'contents options)
#:repair? (memq 'repair options)))))
+ ((list-failures)
+ (for-each (cut simple-format #t "~a~%" <>)
+ (query-failed-paths store)))
+ ((clear-failures)
+ (clear-failed-paths store (map direct-store-path paths)))
((list-dead)
(for-each (cut simple-format #t "~a~%" <>)
(dead-paths store)))