aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/export-import.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-06 18:31:48 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-08-06 18:31:48 +0000
commite89b5bd0bfeb4dfdd8fe7e6929544cb9ceb8a505 (patch)
treee1c6be135632f7da43250eaa57216338d0bad37f /src/libstore/export-import.cc
parent5e59b25a232b9c11b8f8da7e539d17a71fad1bbe (diff)
Minimize the usage of `Hash::dummy`
Diffstat (limited to 'src/libstore/export-import.cc')
-rw-r--r--src/libstore/export-import.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc
index 3f4b7c36f..ccd466d09 100644
--- a/src/libstore/export-import.cc
+++ b/src/libstore/export-import.cc
@@ -69,17 +69,18 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
if (magic != exportMagic)
throw Error("Nix archive cannot be imported; wrong format");
- ValidPathInfo info(parseStorePath(readString(source)));
+ auto path = parseStorePath(readString(source));
//Activity act(*logger, lvlInfo, format("importing path '%s'") % info.path);
- info.references = readStorePaths<StorePathSet>(*this, source);
-
+ auto references = readStorePaths<StorePathSet>(*this, source);
auto deriver = readString(source);
+ auto narHash = hashString(htSHA256, *saved.s);
+
+ ValidPathInfo info { path, narHash };
if (deriver != "")
info.deriver = parseStorePath(deriver);
-
- info.narHash = hashString(htSHA256, *saved.s);
+ info.references = references;
info.narSize = saved.s->size();
// Ignore optional legacy signature.