mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
libstore: Implement DummyStore::narFromPath
This commit is contained in:
parent
3a4c618483
commit
b66c357b58
1 changed files with 7 additions and 1 deletions
|
|
@ -176,7 +176,13 @@ struct DummyStore : virtual Store
|
||||||
|
|
||||||
void narFromPath(const StorePath & path, Sink & sink) override
|
void narFromPath(const StorePath & path, Sink & sink) override
|
||||||
{
|
{
|
||||||
unsupported("narFromPath");
|
auto object = contents.find(path);
|
||||||
|
if (object == contents.end())
|
||||||
|
throw Error("path '%s' is not valid", printStorePath(path));
|
||||||
|
|
||||||
|
const auto & [info, accessor] = object->second;
|
||||||
|
SourcePath sourcePath(accessor);
|
||||||
|
dumpPath(sourcePath, sink, FileSerialisationMethod::NixArchive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue