mirror of
https://github.com/NixOS/nix
synced 2025-06-29 14:53:16 +02:00
Add InputAccessor::fetchToStore()
This commit is contained in:
parent
c0d33087c8
commit
2e0d63caf6
6 changed files with 59 additions and 27 deletions
|
@ -2257,13 +2257,7 @@ StorePath EvalState::copyPathToStore(PathSet & context, const SourcePath & path)
|
|||
auto dstPath = i != srcToStore.end()
|
||||
? i->second
|
||||
: [&]() {
|
||||
auto source = sinkToSource([&](Sink & sink) {
|
||||
path.dumpPath(sink);
|
||||
});
|
||||
auto dstPath =
|
||||
settings.readOnlyMode
|
||||
? store->computeStorePathFromDump(*source, path.baseName()).first
|
||||
: store->addToStoreFromDump(*source, path.baseName(), FileIngestionMethod::Recursive, htSHA256, repair);
|
||||
auto dstPath = path.fetchToStore(store, path.baseName(), nullptr, repair);
|
||||
allowPath(dstPath);
|
||||
srcToStore.insert_or_assign(path, dstPath);
|
||||
printMsg(lvlChatty, "copied source '%1%' -> '%2%'", path, store->printStorePath(dstPath));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue