From 0a7084567fc4e7d077863075a7ea1bb82d843341 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 3 Oct 2012 15:09:18 -0400 Subject: Add a ‘--repair’ flag to nix-instantiate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows repairing corrupted derivations and other source files. --- src/libstore/remote-store.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libstore/remote-store.cc') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 2a895593b25c..08e409d3f058 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -419,8 +419,10 @@ Path RemoteStore::queryPathFromHashPart(const string & hashPart) Path RemoteStore::addToStore(const Path & _srcPath, - bool recursive, HashType hashAlgo, PathFilter & filter) + bool recursive, HashType hashAlgo, PathFilter & filter, bool repair) { + if (repair) throw Error("repairing is not supported when building through the Nix daemon"); + openConnection(); Path srcPath(absPath(_srcPath)); @@ -438,8 +440,10 @@ Path RemoteStore::addToStore(const Path & _srcPath, Path RemoteStore::addTextToStore(const string & name, const string & s, - const PathSet & references) + const PathSet & references, bool repair) { + if (repair) throw Error("repairing is not supported when building through the Nix daemon"); + openConnection(); writeInt(wopAddTextToStore, to); writeString(name, to); @@ -476,7 +480,7 @@ Paths RemoteStore::importPaths(bool requireSignature, Source & source) void RemoteStore::buildPaths(const PathSet & drvPaths, bool repair) { - if (repair) throw Error("`--repair' is not supported when building through the Nix daemon"); + if (repair) throw Error("repairing is not supported when building through the Nix daemon"); openConnection(); writeInt(wopBuildPaths, to); writeStrings(drvPaths, to); -- cgit 1.4.1