mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Remove now-redundant text-hashing store methods
`addTextToStore` and `computeStorePathFromDump` are now redundant. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
dfc876531f
commit
ed26b186fb
18 changed files with 83 additions and 212 deletions
|
@ -143,8 +143,14 @@ StorePath writeDerivation(Store & store,
|
|||
auto suffix = std::string(drv.name) + drvExtension;
|
||||
auto contents = drv.unparse(store, false);
|
||||
return readOnly || settings.readOnlyMode
|
||||
? store.computeStorePathForText(suffix, contents, references)
|
||||
: store.addTextToStore(suffix, contents, references, repair);
|
||||
? store.makeFixedOutputPathFromCA(suffix, TextInfo {
|
||||
.hash = hashString(HashAlgorithm::SHA256, contents),
|
||||
.references = std::move(references),
|
||||
})
|
||||
: ({
|
||||
StringSource s { contents };
|
||||
store.addToStoreFromDump(s, suffix, TextIngestionMethod {}, HashAlgorithm::SHA256, references, repair);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue