aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03 15:09:18 -0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03 15:09:18 -0400
commit0a7084567fc4e7d077863075a7ea1bb82d843341 (patch)
tree4868d450da1e153b0660eede85105cb2b14d0859 /src/libexpr/eval.cc
parenta807edfae8428bf426ee6ae849a7a24d74d39202 (diff)
Add a ‘--repair’ flag to nix-instantiate
This allows repairing corrupted derivations and other source files.
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 9e5be908f..2f9601ec5 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);