From 8e3a7bd71253f02eb1a9fbb996166727b1283887 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 2 Oct 2012 15:04:59 -0400 Subject: nix-store --verify: Add an option ‘--repair’ to repair all missing/corrupt paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, return a non-zero exit code if errors remain after verifying/repairing. --- src/libstore/local-store.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 80db10de10d0..9f1c8280a8de 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -171,8 +171,9 @@ public: /* Optimise a single store path. */ void optimisePath(const Path & path); - /* Check the integrity of the Nix store. */ - void verifyStore(bool checkContents); + /* Check the integrity of the Nix store. Returns true if errors + remain. */ + bool verifyStore(bool checkContents, bool repair); /* Register the validity of a path, i.e., that `path' exists, that the paths referenced by it exists, and in the case of an output @@ -250,7 +251,7 @@ private: void invalidatePathChecked(const Path & path); void verifyPath(const Path & path, const PathSet & store, - PathSet & done, PathSet & validPaths); + PathSet & done, PathSet & validPaths, bool repair, bool & errors); void updatePathInfo(const ValidPathInfo & info); -- cgit 1.4.1