aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/export-import.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-18 21:38:15 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-18 21:38:15 +0000
commit40526fbea56a8006eb7f1758d461a5acbe9a1694 (patch)
tree5d74492a86f28fb7183897dc2a6d7baf2d24f7f1 /src/libstore/export-import.cc
parent6dd471ebf6b9a4996405398093ccb371b8abdf2f (diff)
parent6c000eed80565d83d596da800ca0db92e248342e (diff)
Merge remote-tracking branch 'upstream/master' into enum-class
Diffstat (limited to 'src/libstore/export-import.cc')
-rw-r--r--src/libstore/export-import.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index 8a5e9d08e..9e5554251 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -1,3 +1,4 @@
+#include "serialise.hh"
#include "store-api.hh"
#include "archive.hh"
#include "worker-protocol.hh"
@@ -56,7 +57,7 @@ void Store::exportPath(const StorePath & path, Sink & sink)
Hash hash = hashAndWriteSink.currentHash();
if (hash != info->narHash && info->narHash != Hash(info->narHash.type))
throw Error("hash of path '%s' has changed from '%s' to '%s'!",
- printStorePath(path), info->narHash.to_string(), hash.to_string());
+ printStorePath(path), info->narHash.to_string(Base::Base32, true), hash.to_string(Base::Base32, true));
hashAndWriteSink
<< exportMagic
@@ -100,9 +101,11 @@ StorePaths Store::importPaths(Source & source, std::shared_ptr<FSAccessor> acces
if (readInt(source) == 1)
readString(source);
- addToStore(info, tee.source.data, NoRepair, checkSigs, accessor);
+ // Can't use underlying source, which would have been exhausted
+ auto source = StringSource { *tee.source.data };
+ addToStore(info, source, NoRepair, checkSigs, accessor);
- res.push_back(info.path.clone());
+ res.push_back(info.path);
}
return res;