diff options
author | John Ericson <git@JohnEricson.me> | 2020-03-22 23:43:07 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2020-03-30 11:33:35 -0400 |
commit | 832bd534dc0ab36fd8267f62b67ab1db1498d2b4 (patch) | |
tree | 53bf9703f35de4d06bdfb02909304b71f89c6fb1 /src/nix/show-derivation.cc | |
parent | f5494d94429f7eda6a7fa1b48c7220f569ab0c28 (diff) |
Store parsed hashes in `DerivationOutput`
It's best to detect invalid data as soon as possible, with data types
that make storing it impossible.
Diffstat (limited to 'src/nix/show-derivation.cc')
-rw-r--r-- | src/nix/show-derivation.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix/show-derivation.cc b/src/nix/show-derivation.cc index 0ede7b468..b2ec71dbb 100644 --- a/src/nix/show-derivation.cc +++ b/src/nix/show-derivation.cc @@ -69,9 +69,9 @@ struct CmdShowDerivation : InstallablesCommand for (auto & output : drv.outputs) { auto outputObj(outputsObj.object(output.first)); outputObj.attr("path", store->printStorePath(output.second.path)); - if (output.second.hash != "") { - outputObj.attr("hashAlgo", output.second.hashAlgo); - outputObj.attr("hash", output.second.hash); + if (output.second.hash) { + outputObj.attr("hashAlgo", output.second.hash->printMethodAlgo()); + outputObj.attr("hash", output.second.hash->hash.to_string(Base16, false)); } } } |