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/derivations.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstore/derivations.cc') diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc index 73047c7538a0..e0a4f43c0bb8 100644 --- a/src/libstore/derivations.cc +++ b/src/libstore/derivations.cc @@ -27,7 +27,7 @@ void DerivationOutput::parseHashInfo(bool & recursive, HashType & hashType, Hash Path writeDerivation(StoreAPI & store, - const Derivation & drv, const string & name) + const Derivation & drv, const string & name, bool repair) { PathSet references; references.insert(drv.inputSrcs.begin(), drv.inputSrcs.end()); @@ -40,7 +40,7 @@ Path writeDerivation(StoreAPI & store, string contents = unparseDerivation(drv); return settings.readOnlyMode ? computeStorePathForText(suffix, contents, references) - : store.addTextToStore(suffix, contents, references); + : store.addTextToStore(suffix, contents, references, repair); } -- cgit 1.4.1