aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-28 11:49:13 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-28 11:49:13 -0500
commit123b11ff83da0cbcef6e4aae276bfbdd7a183656 (patch)
treecf51e8562e2d90e991541f66f9d2e5fc46aa0d0c
parentd12f57c2c0ef32180875aa4a0b803c838a7d988f (diff)
Clarify store path grammar and improve comment on `makeType`
-rw-r--r--src/libstore/store-api.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index 73dcaf150..2ff92c0e6 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -99,10 +99,12 @@ StorePath Store::followLinksToStorePath(std::string_view path) const
silly, but it's done that way for compatibility). <id> is the
name of the output (usually, "out").
- <h2> = base-16 representation of a SHA-256 hash of:
+ <h2> = base-16 representation of a SHA-256 hash of <s2>
+
+ <s2> =
if <type> = "text:...":
the string written to the resulting store path
- if <type> = "source":
+ if <type> = "source:...":
the serialisation of the path from which this store path is
copied, as returned by hashPath()
if <type> = "output:<id>":
@@ -164,8 +166,8 @@ StorePath Store::makeOutputPath(std::string_view id,
/* Stuff the references (if any) into the type. This is a bit
- hacky, but we can't put them in `s' since that would be
- ambiguous. */
+ hacky, but we can't put them in, say, <s2> (per the grammar above)
+ since that would be ambiguous. */
static std::string makeType(
const Store & store,
std::string && type,