mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 05:56:15 +02:00
fetchToStore(): Handle flat ingestion method and add test
This commit is contained in:
parent
173abec0bc
commit
7a086a32bc
3 changed files with 20 additions and 9 deletions
|
@ -14,7 +14,10 @@ StorePath InputAccessor::fetchToStore(
|
|||
Activity act(*logger, lvlChatty, actUnknown, fmt("copying '%s' to the store", showPath(path)));
|
||||
|
||||
auto source = sinkToSource([&](Sink & sink) {
|
||||
if (method == FileIngestionMethod::Recursive)
|
||||
dumpPath(path, sink, filter ? *filter : defaultPathFilter);
|
||||
else
|
||||
sink(readFile(path)); // FIXME: stream
|
||||
});
|
||||
|
||||
auto storePath =
|
||||
|
|
|
@ -1 +1 @@
|
|||
"/nix/store/ya937r4ydw0l6kayq8jkyqaips9c75jm-output"
|
||||
[ "/nix/store/ya937r4ydw0l6kayq8jkyqaips9c75jm-output" "/nix/store/m7y372g6jb0g4hh1dzmj847rd356fhnz-output" ]
|
||||
|
|
|
@ -1,7 +1,15 @@
|
|||
builtins.path
|
||||
[
|
||||
(builtins.path
|
||||
{ path = ./.;
|
||||
filter = path: _: baseNameOf path == "data";
|
||||
recursive = true;
|
||||
sha256 = "1yhm3gwvg5a41yylymgblsclk95fs6jy72w0wv925mmidlhcq4sw";
|
||||
name = "output";
|
||||
}
|
||||
})
|
||||
(builtins.path
|
||||
{ path = ./data;
|
||||
recursive = false;
|
||||
sha256 = "0k4lwj58f2w5yh92ilrwy9917pycipbrdrr13vbb3yd02j09vfxm";
|
||||
name = "output";
|
||||
})
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue