From c63d94035f7cff02d885f9deaaf4011d52a1151d Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 6 Jun 2015 19:05:25 +0200 Subject: store: Add 'verify-store' RPC. * guix/store.scm (operation-id): Add 'verify-store'. (verify-store): New procedure. (set-build-options): Adjust comment. * tests/store.scm ("verify-store", "verify-store + check-contents"): New tests. --- guix/store.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/store.scm b/guix/store.scm index 8905a5a558..933708defc 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -91,6 +91,7 @@ requisites referrers optimize-store + verify-store topologically-sorted valid-derivers query-derivation-outputs @@ -174,7 +175,8 @@ (query-valid-paths 31) (query-substitutable-paths 32) (query-valid-derivers 33) - (optimize-store 34)) + (optimize-store 34) + (verify-store 35)) (define-enumerate-type hash-algo ;; hash.hh @@ -497,8 +499,8 @@ encoding conversion errors." ;; Client-provided substitute URLs. For ;; unprivileged clients, these are considered - ;; "untrusted"; for root, they override the - ;; daemon's settings. + ;; "untrusted"; for "trusted" users, they override + ;; the daemon's settings. (substitute-urls %default-substitute-urls)) ;; Must be called after `open-connection'. @@ -769,6 +771,19 @@ Return #t on success." ;; Note: the daemon in Guix <= 0.8.2 does not implement this RPC. boolean) +(define verify-store + (let ((verify (operation (verify-store (boolean check-contents?) + (boolean repair?)) + "Verify the store." + boolean))) + (lambda* (store #:key check-contents? repair?) + "Verify the integrity of the store and return false if errors remain, +and true otherwise. When REPAIR? is true, repair any missing or altered store +items by substituting them (this typically requires root privileges because it +is not an atomic operation.) When CHECK-CONTENTS? is true, check the contents +of store items; this can take a lot of time." + (not (verify store check-contents? repair?))))) + (define (run-gc server action to-delete min-freed) "Perform the garbage-collector operation ACTION, one of the `gc-action' values. When ACTION is `delete-specific', the TO-DELETE is -- cgit v1.2.3