aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:36:05 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-01-06 15:36:05 -0500
commit46e942ff9e65755689ee72f93846d7118e1b8d45 (patch)
tree81c51237516835c37cb21407a391c905c16b5c08 /src/libexpr
parent9cfa78e58a92b4bf034867bc1296a200bdc3f12a (diff)
Do big rename to clean up code
- `PathReferences` -> `References` - `PathReferences<StorePath>` -> `StoreReference` - `references` -> `others` - `hasSelfReference` -> `self` And get rid of silly subclassing
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 8a19eab8f..0113659d1 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1535,7 +1535,8 @@ static void prim_readFile(EvalState & state, const PosIdx pos, Value * * args, V
StorePathSet refs;
if (state.store->isInStore(path)) {
try {
- refs = state.store->queryPathInfo(state.store->toStorePath(path).first)->references;
+ // FIXME: Are self references becoming non-self references OK?
+ refs = state.store->queryPathInfo(state.store->toStorePath(path).first)->referencesPossiblyToSelf();
} catch (Error &) { // FIXME: should be InvalidPathError
}
// Re-scan references to filter down to just the ones that actually occur in the file.
@@ -1971,7 +1972,7 @@ static void addPath(
try {
auto [storePath, subPath] = state.store->toStorePath(path);
// FIXME: we should scanForReferences on the path before adding it
- refs = state.store->queryPathInfo(storePath)->references;
+ refs = state.store->queryPathInfo(storePath)->referencesPossiblyToSelf();
path = state.store->toRealPath(storePath) + subPath;
} catch (Error &) { // FIXME: should be InvalidPathError
}
@@ -2010,7 +2011,7 @@ static void addPath(
.method = method,
.hash = *expectedHash,
},
- {},
+ .references = {},
});
if (!expectedHash || !state.store->isValidPath(*expectedStorePath)) {