aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
authorCarlo Nucera <carlo.nucera@protonmail.com>2020-07-28 14:22:24 -0400
committerCarlo Nucera <carlo.nucera@protonmail.com>2020-07-28 14:22:24 -0400
commitc318d398f37714c98f16b83d3afcafa856f91266 (patch)
tree35eb840a8c09e4bd83b9837bbb0b5f610e2b29b6 /src/nix-store
parent7ef1e3cd1429f336c568ccf4d59cd89cde68efbd (diff)
parent7cf978440c62b6677b068f10ee7ef22a09e7b1b8 (diff)
Merge branch 'misc-ca' of github.com:obsidiansystems/nix into new-interface-for-path-pathOpt
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/nix-store.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 87888a1d0..8e2cb7f68 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -372,8 +372,8 @@ static void opQuery(Strings opFlags, Strings opArgs)
for (auto & j : maybeUseOutputs(store->followLinksToStorePath(i), useOutput, forceRealise)) {
auto info = store->queryPathInfo(j);
if (query == qHash) {
- assert(info->narHash.type == htSHA256);
- cout << fmt("%s\n", info->narHash.to_string(Base32, true));
+ assert(info->narHash && info->narHash->type == htSHA256);
+ cout << fmt("%s\n", info->narHash->to_string(Base32, true));
} else if (query == qSize)
cout << fmt("%d\n", info->narSize);
}
@@ -725,7 +725,7 @@ static void opVerifyPath(Strings opFlags, Strings opArgs)
auto path = store->followLinksToStorePath(i);
printMsg(lvlTalkative, "checking path '%s'...", store->printStorePath(path));
auto info = store->queryPathInfo(path);
- HashSink sink(*info->narHash.type);
+ HashSink sink(info->narHash->type);
store->narFromPath(path, sink);
auto current = sink.finish();
if (current.first != info->narHash) {
@@ -734,7 +734,7 @@ static void opVerifyPath(Strings opFlags, Strings opArgs)
.hint = hintfmt(
"path '%s' was modified! expected hash '%s', got '%s'",
store->printStorePath(path),
- info->narHash.to_string(Base32, true),
+ info->narHash->to_string(Base32, true),
current.first.to_string(Base32, true))
});
status = 1;
@@ -864,7 +864,9 @@ static void opServe(Strings opFlags, Strings opArgs)
out << info->narSize // downloadSize
<< info->narSize;
if (GET_PROTOCOL_MINOR(clientVersion) >= 4)
- out << (info->narHash ? info->narHash.to_string(Base32, true) : "") << renderContentAddress(info->ca) << info->sigs;
+ out << (info->narHash ? info->narHash->to_string(Base32, true) : "")
+ << renderContentAddress(info->ca)
+ << info->sigs;
} catch (InvalidPath &) {
}
}