1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 21:50:58 +01:00

Fix read-only copyPathToStore()

This commit is contained in:
Eelco Dolstra 2022-05-11 14:22:18 +02:00
parent 95e4376434
commit eb966921ca
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 24 additions and 7 deletions

View file

@ -230,6 +230,19 @@ std::pair<StorePath, Hash> Store::computeStorePathForPath(std::string_view name,
}
std::pair<StorePath, Hash> Store::computeStorePathFromDump(
Source & dump,
std::string_view name,
FileIngestionMethod method,
HashType hashAlgo) const
{
HashSink sink(hashAlgo);
dump.drainInto(sink);
auto hash = sink.finish().first;
return {makeFixedOutputPath(method, hash, name), hash};
}
StorePath Store::computeStorePathForText(
std::string_view name,
std::string_view s,