aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/nar-info.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-18 23:01:58 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-18 23:01:58 +0000
commit3f8dcfe3fd8372ee8fc1b3233c7e9982d1a6915d (patch)
tree5a104db035aede46168326978dd3bc387f9e49a7 /src/libstore/nar-info.cc
parentd614166cb6864f2448b9e03f8dccccf301dc541e (diff)
parent669c3992e883414269d850bba5f00c59a1b207d0 (diff)
Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatype
Diffstat (limited to 'src/libstore/nar-info.cc')
-rw-r--r--src/libstore/nar-info.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc
index fe37d67ec..04550ed97 100644
--- a/src/libstore/nar-info.cc
+++ b/src/libstore/nar-info.cc
@@ -4,10 +4,10 @@
namespace nix {
NarInfo::NarInfo(const Store & store, const std::string & s, const std::string & whence)
- : ValidPathInfo(StorePath::dummy) // FIXME: hack
+ : ValidPathInfo(StorePath(StorePath::dummy)) // FIXME: hack
{
auto corrupt = [&]() {
- throw Error(format("NAR info file '%1%' is corrupt") % whence);
+ throw Error("NAR info file '%1%' is corrupt", whence);
};
auto parseHashField = [&](const string & s) {
@@ -56,11 +56,11 @@ NarInfo::NarInfo(const Store & store, const std::string & s, const std::string &
auto refs = tokenizeString<Strings>(value, " ");
if (!references.empty()) corrupt();
for (auto & r : refs)
- references.insert(StorePath::fromBaseName(r));
+ references.insert(StorePath(r));
}
else if (name == "Deriver") {
if (value != "unknown-deriver")
- deriver = StorePath::fromBaseName(value);
+ deriver = StorePath(value);
}
else if (name == "System")
system = value;
@@ -87,11 +87,11 @@ std::string NarInfo::to_string(const Store & store) const
res += "URL: " + url + "\n";
assert(compression != "");
res += "Compression: " + compression + "\n";
- assert(fileHash.type == HashType::SHA256);
- res += "FileHash: " + fileHash.to_string(Base::Base32) + "\n";
+ assert(fileHash.type == htSHA256);
+ res += "FileHash: " + fileHash.to_string(Base32, true) + "\n";
res += "FileSize: " + std::to_string(fileSize) + "\n";
- assert(narHash.type == HashType::SHA256);
- res += "NarHash: " + narHash.to_string(Base::Base32) + "\n";
+ assert(narHash.type == htSHA256);
+ res += "NarHash: " + narHash.to_string(Base32, true) + "\n";
res += "NarSize: " + std::to_string(narSize) + "\n";
res += "References: " + concatStringsSep(" ", shortRefs()) + "\n";