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/libexpr/eval.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libexpr/eval.cc') diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 9e5be908f089..2f9601ec550f 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -141,6 +141,7 @@ EvalState::EvalState() , baseEnv(allocEnv(128)) , baseEnvDispl(0) , staticBaseEnv(false, 0) + , repair(false) { nrEnvs = nrValuesInEnvs = nrValues = nrListElems = 0; nrAttrsets = nrOpUpdates = nrOpUpdateValuesCopied = 0; @@ -1093,7 +1094,7 @@ string EvalState::coerceToString(Value & v, PathSet & context, else { dstPath = settings.readOnlyMode ? computeStorePathForPath(path).first - : store->addToStore(path); + : store->addToStore(path, true, htSHA256, defaultPathFilter, repair); srcToStore[path] = dstPath; printMsg(lvlChatty, format("copied source `%1%' -> `%2%'") % path % dstPath); -- cgit 1.4.1