about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03T19·09-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-10-03T19·09-0400
commit0a7084567fc4e7d077863075a7ea1bb82d843341 (patch)
tree4868d450da1e153b0660eede85105cb2b14d0859 /src/libexpr/primops.cc
parenta807edfae8428bf426ee6ae849a7a24d74d39202 (diff)
Add a ‘--repair’ flag to nix-instantiate
This allows repairing corrupted derivations and other source files.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index bbe89c5f55be..509297003f6e 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -487,7 +487,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
     }
 
     /* Write the resulting term into the Nix store directory. */
-    Path drvPath = writeDerivation(*store, drv, drvName);
+    Path drvPath = writeDerivation(*store, drv, drvName, state.repair);
 
     printMsg(lvlChatty, format("instantiated `%1%' -> `%2%'")
         % drvName % drvPath);
@@ -625,7 +625,7 @@ static void prim_toFile(EvalState & state, Value * * args, Value & v)
     
     Path storePath = settings.readOnlyMode
         ? computeStorePathForText(name, contents, refs)
-        : store->addTextToStore(name, contents, refs);
+        : store->addTextToStore(name, contents, refs, state.repair);
 
     /* Note: we don't need to add `context' to the context of the
        result, since `storePath' itself has references to the paths
@@ -689,7 +689,7 @@ static void prim_filterSource(EvalState & state, Value * * args, Value & v)
 
     Path dstPath = settings.readOnlyMode
         ? computeStorePathForPath(path, true, htSHA256, filter).first
-        : store->addToStore(path, true, htSHA256, filter);
+        : store->addToStore(path, true, htSHA256, filter, state.repair);
 
     mkString(v, dstPath, singleton<PathSet>(dstPath));
 }