From b755752f7666441e710bee9f0c21f233808874c7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Jun 2015 23:20:11 +0200 Subject: Add a ‘verifyStore’ RPC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello! The patch below adds a ‘verifyStore’ RPC with the same signature as the current LocalStore::verifyStore method. Thanks, Ludo’. >From aef46c03ca77eb6344f4892672eb6d9d06432041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 1 Jun 2015 23:17:10 +0200 Subject: [PATCH] Add a 'verifyStore' remote procedure call. --- src/nix-daemon/nix-daemon.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nix-daemon/nix-daemon.cc') diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index bed7de0859a3..b3552a972f8d 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -519,6 +519,16 @@ static void performOp(bool trusted, unsigned int clientVersion, writeInt(1, to); break; + case wopVerifyStore: { + bool checkContents = readInt(from) != 0; + bool repair = readInt(from) != 0; + startWork(); + bool errors = store->verifyStore(checkContents, repair); + stopWork(); + writeInt(errors, to); + break; + } + default: throw Error(format("invalid operation %1%") % op); } -- cgit 1.4.1