1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

Add a ‘--repair’ flag to nix-instantiate

This allows repairing corrupted derivations and other source files.
This commit is contained in:
Eelco Dolstra 2012-10-03 15:09:18 -04:00
parent a807edfae8
commit 0a7084567f
11 changed files with 36 additions and 25 deletions

View file

@ -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);
}