aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/nar-info.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-23 17:03:10 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-23 17:03:37 +0000
commit98e5d1af03d1045ec1874c94b88cc21a727e28f2 (patch)
tree46a426c84272d8118d3d7757986996cb9a565a81 /src/libstore/nar-info.cc
parent3dc10f73931d6eaa41e28a4d763a2dc3965fd6c3 (diff)
parent015e1c2131de938d61fa50c8df9d3987c42bcb39 (diff)
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
Diffstat (limited to 'src/libstore/nar-info.cc')
-rw-r--r--src/libstore/nar-info.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstore/nar-info.cc b/src/libstore/nar-info.cc
index fb84b0410..c403d4bec 100644
--- a/src/libstore/nar-info.cc
+++ b/src/libstore/nar-info.cc
@@ -66,8 +66,9 @@ NarInfo::NarInfo(const Store & store, const std::string & s, const std::string &
else if (name == "Sig")
sigs.insert(value);
else if (name == "CA") {
- if (!ca.empty()) throw corrupt();
- ca = value;
+ if (!value.empty()) throw corrupt();
+ // FIXME: allow blank ca or require skipping field?
+ ca = parseContentAddressOpt(value);
}
pos = eol + 1;
@@ -103,8 +104,8 @@ std::string NarInfo::to_string(const Store & store) const
for (auto sig : sigs)
res += "Sig: " + sig + "\n";
- if (!ca.empty())
- res += "CA: " + ca + "\n";
+ if (ca)
+ res += "CA: " + renderContentAddress(*ca) + "\n";
return res;
}