aboutsummaryrefslogtreecommitdiff
path: root/src/nix/add-to-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/add-to-store.cc')
-rw-r--r--src/nix/add-to-store.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nix/add-to-store.cc b/src/nix/add-to-store.cc
index 296b2c7e4..139db3657 100644
--- a/src/nix/add-to-store.cc
+++ b/src/nix/add-to-store.cc
@@ -40,16 +40,17 @@ struct CmdAddToStore : MixDryRun, StoreCommand
StringSink sink;
dumpPath(path, sink);
- ValidPathInfo info;
- info.narHash = hashString(htSHA256, *sink.s);
+ auto narHash = hashString(htSHA256, *sink.s);
+
+ ValidPathInfo info(store->makeFixedOutputPath(true, narHash, *namePart));
+ info.narHash = narHash;
info.narSize = sink.s->size();
- info.path = store->makeFixedOutputPath(true, info.narHash, *namePart);
info.ca = makeFixedOutputCA(true, info.narHash);
if (!dryRun)
store->addToStore(info, sink.s);
- std::cout << fmt("%s\n", info.path);
+ std::cout << fmt("%s\n", store->printStorePath(info.path));
}
};