1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

Add a Store::addToStore() variant that accepts a NAR

As a side effect, this ensures that signatures are propagated when
copying paths between stores.

Also refactored import/export to make use of this.
This commit is contained in:
Eelco Dolstra 2016-05-04 13:36:54 +02:00
parent b6c768fb6a
commit 538a64e8c3
15 changed files with 235 additions and 338 deletions

View file

@ -46,8 +46,6 @@ private:
std::string narInfoFileFor(const Path & storePath);
void addToCache(const ValidPathInfo & info, ref<std::string> nar);
public:
bool isValidPathUncached(const Path & path) override;
@ -82,6 +80,9 @@ public:
void querySubstitutablePathInfos(const PathSet & paths,
SubstitutablePathInfos & infos) override;
void addToStore(const ValidPathInfo & info, const std::string & nar,
bool repair = false) override;
Path addToStore(const string & name, const Path & srcPath,
bool recursive = true, HashType hashAlgo = htSHA256,
PathFilter & filter = defaultPathFilter, bool repair = false) override;
@ -91,13 +92,6 @@ public:
void narFromPath(const Path & path, Sink & sink) override;
void exportPath(const Path & path, Sink & sink) override;
Paths importPaths(Source & source,
std::shared_ptr<FSAccessor> accessor) override;
Path importPath(Source & source, std::shared_ptr<FSAccessor> accessor);
void buildPaths(const PathSet & paths, BuildMode buildMode = bmNormal) override;
BuildResult buildDerivation(const Path & drvPath, const BasicDerivation & drv,