aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/binary-cache-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/binary-cache-store.cc')
-rw-r--r--src/libstore/binary-cache-store.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libstore/binary-cache-store.cc b/src/libstore/binary-cache-store.cc
index 94f5cbabb..de456752b 100644
--- a/src/libstore/binary-cache-store.cc
+++ b/src/libstore/binary-cache-store.cc
@@ -156,10 +156,8 @@ bool BinaryCacheStore::isValidPath(const Path & storePath)
return fileExists(narInfoFileFor(storePath));
}
-void BinaryCacheStore::exportPath(const Path & storePath, bool sign, Sink & sink)
+void BinaryCacheStore::dumpPath(const Path & storePath, Sink & sink)
{
- assert(!sign);
-
auto res = readNarInfo(storePath);
auto nar = getFile(res.url);
@@ -183,6 +181,15 @@ void BinaryCacheStore::exportPath(const Path & storePath, bool sign, Sink & sink
assert(nar.size() % 8 == 0);
sink((unsigned char *) nar.c_str(), nar.size());
+}
+
+void BinaryCacheStore::exportPath(const Path & storePath, bool sign, Sink & sink)
+{
+ assert(!sign);
+
+ auto res = readNarInfo(storePath);
+
+ dumpPath(storePath, sink);
// FIXME: check integrity of NAR.
@@ -264,7 +271,7 @@ Path BinaryCacheStore::addToStore(const string & name, const Path & srcPath,
StringSink sink;
Hash h;
if (recursive) {
- dumpPath(srcPath, sink, filter);
+ nix::dumpPath(srcPath, sink, filter);
h = hashString(hashAlgo, *sink.s);
} else {
auto s = readFile(srcPath);