diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-20 18:14:12 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-08-20 18:14:12 +0000 |
commit | 45a2f1baaba8dbd4a4fb27b6ab9baee3c2820220 (patch) | |
tree | 5fa1824225148c766c930dfeade53c7573c07ebc /src/libstore | |
parent | f899a7c6d726dbf75e78fce5b5a9aa478387fcbe (diff) |
Rename drv output querying functions, like master
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap`
- `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build.cc | 26 | ||||
-rw-r--r-- | src/libstore/daemon.cc | 2 | ||||
-rw-r--r-- | src/libstore/local-store.cc | 2 | ||||
-rw-r--r-- | src/libstore/local-store.hh | 2 | ||||
-rw-r--r-- | src/libstore/misc.cc | 2 | ||||
-rw-r--r-- | src/libstore/remote-store.cc | 2 | ||||
-rw-r--r-- | src/libstore/remote-store.hh | 2 | ||||
-rw-r--r-- | src/libstore/store-api.cc | 6 | ||||
-rw-r--r-- | src/libstore/store-api.hh | 6 |
9 files changed, 25 insertions, 25 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index db93d6092..ba28e78c8 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1041,8 +1041,8 @@ private: /* Wrappers around the corresponding Store methods that first consult the derivation. This is currently needed because when there is no drv file there also is no DB entry. */ - std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(); - OutputPathMap queryDerivationOutputMapAssumeTotal(); + std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(); + OutputPathMap queryDerivationOutputMap(); /* Return the set of (in)valid paths. */ void checkPathValidity(); @@ -1367,7 +1367,7 @@ void DerivationGoal::repairClosure() that produced those outputs. */ /* Get the output closure. */ - auto outputs = queryDerivationOutputMapAssumeTotal(); + auto outputs = queryDerivationOutputMap(); StorePathSet outputClosure; for (auto & i : outputs) { if (!wantOutput(i.first, wantedOutputs)) continue; @@ -1386,7 +1386,7 @@ void DerivationGoal::repairClosure() std::map<StorePath, StorePath> outputsToDrv; for (auto & i : inputClosure) if (i.isDerivation()) { - auto depOutputs = worker.store.queryDerivationOutputMap(i); + auto depOutputs = worker.store.queryPartialDerivationOutputMap(i); for (auto & j : depOutputs) if (j.second) outputsToDrv.insert_or_assign(*j.second, i); @@ -1457,7 +1457,7 @@ void DerivationGoal::inputsRealised() `i' as input paths. Only add the closures of output paths that are specified as inputs. */ assert(worker.store.isValidPath(drvPath)); - auto outputs = worker.store.queryDerivationOutputMap(depDrvPath); + auto outputs = worker.store.queryPartialDerivationOutputMap(depDrvPath); for (auto & j : wantedDepOutputs) { if (outputs.count(j) > 0) { auto optRealizedInput = outputs.at(j); @@ -2912,11 +2912,11 @@ struct RestrictedStore : public LocalFSStore void queryReferrers(const StorePath & path, StorePathSet & referrers) override { } - std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(const StorePath & path) override + std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) override { if (!goal.isAllowed(path)) throw InvalidPath("cannot query output map for unknown path '%s' in recursive Nix", printStorePath(path)); - return next->queryDerivationOutputMap(path); + return next->queryPartialDerivationOutputMap(path); } std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override @@ -2979,7 +2979,7 @@ struct RestrictedStore : public LocalFSStore for (auto & path : paths) { if (!path.path.isDerivation()) continue; - auto outputs = next->queryDerivationOutputMapAssumeTotal(path.path); + auto outputs = next->queryDerivationOutputMap(path.path); for (auto & output : outputs) if (wantOutput(output.first, path.outputs)) newPaths.insert(output.second); @@ -4548,7 +4548,7 @@ void DerivationGoal::flushLine() } -std::map<std::string, std::optional<StorePath>> DerivationGoal::queryDerivationOutputMap() +std::map<std::string, std::optional<StorePath>> DerivationGoal::queryPartialDerivationOutputMap() { if (drv->type() != DerivationType::CAFloating) { std::map<std::string, std::optional<StorePath>> res; @@ -4556,11 +4556,11 @@ std::map<std::string, std::optional<StorePath>> DerivationGoal::queryDerivationO res.insert_or_assign(name, output.pathOpt(worker.store, drv->name, name)); return res; } else { - return worker.store.queryDerivationOutputMap(drvPath); + return worker.store.queryPartialDerivationOutputMap(drvPath); } } -OutputPathMap DerivationGoal::queryDerivationOutputMapAssumeTotal() +OutputPathMap DerivationGoal::queryDerivationOutputMap() { if (drv->type() != DerivationType::CAFloating) { OutputPathMap res; @@ -4568,7 +4568,7 @@ OutputPathMap DerivationGoal::queryDerivationOutputMapAssumeTotal() res.insert_or_assign(name, *output.second); return res; } else { - return worker.store.queryDerivationOutputMapAssumeTotal(drvPath); + return worker.store.queryDerivationOutputMap(drvPath); } } @@ -4576,7 +4576,7 @@ OutputPathMap DerivationGoal::queryDerivationOutputMapAssumeTotal() void DerivationGoal::checkPathValidity() { bool checkHash = buildMode == bmRepair; - for (auto & i : queryDerivationOutputMap()) { + for (auto & i : queryPartialDerivationOutputMap()) { InitialOutputStatus status { .wanted = wantOutput(i.first, wantedOutputs), }; diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index 046dfbe6e..a4eeebaab 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -325,7 +325,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store, case wopQueryDerivationOutputMap: { auto path = store->parseStorePath(readString(from)); logger->startWork(); - auto outputs = store->queryDerivationOutputMap(path); + auto outputs = store->queryPartialDerivationOutputMap(path); logger->stopWork(); worker_proto::write(*store, to, outputs); break; diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 634a8046b..0086bb13e 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -803,7 +803,7 @@ StorePathSet LocalStore::queryValidDerivers(const StorePath & path) } -std::map<std::string, std::optional<StorePath>> LocalStore::queryDerivationOutputMap(const StorePath & path) +std::map<std::string, std::optional<StorePath>> LocalStore::queryPartialDerivationOutputMap(const StorePath & path) { std::map<std::string, std::optional<StorePath>> outputs; BasicDerivation drv = readDerivation(path); diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index bf4016b13..4d99e5cf6 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -133,7 +133,7 @@ public: StorePathSet queryValidDerivers(const StorePath & path) override; - std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(const StorePath & path) override; + std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) override; std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override; diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 9024fb2bd..da3981696 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -207,7 +207,7 @@ void Store::queryMissing(const std::vector<StorePathWithOutputs> & targets, /* true for regular derivations, and CA derivations for which we have a trust mapping for all wanted outputs. */ auto knownOutputPaths = true; - for (auto & [outputName, pathOpt] : queryDerivationOutputMap(path.path)) { + for (auto & [outputName, pathOpt] : queryPartialDerivationOutputMap(path.path)) { if (!pathOpt) { knownOutputPaths = false; break; diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 1b1260900..adba17c5e 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -474,7 +474,7 @@ StorePathSet RemoteStore::queryDerivationOutputs(const StorePath & path) } -std::map<std::string, std::optional<StorePath>> RemoteStore::queryDerivationOutputMap(const StorePath & path) +std::map<std::string, std::optional<StorePath>> RemoteStore::queryPartialDerivationOutputMap(const StorePath & path) { auto conn(getConnection()); conn->to << wopQueryDerivationOutputMap << printStorePath(path); diff --git a/src/libstore/remote-store.hh b/src/libstore/remote-store.hh index 4b093ad3b..b319e774b 100644 --- a/src/libstore/remote-store.hh +++ b/src/libstore/remote-store.hh @@ -51,7 +51,7 @@ public: StorePathSet queryDerivationOutputs(const StorePath & path) override; - std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(const StorePath & path) override; + std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) override; std::optional<StorePath> queryPathFromHashPart(const std::string & hashPart) override; StorePathSet querySubstitutablePaths(const StorePathSet & paths) override; diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 1f10f0663..09608646e 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -366,8 +366,8 @@ bool Store::PathInfoCacheValue::isKnownNow() return std::chrono::steady_clock::now() < time_point + ttl; } -OutputPathMap Store::queryDerivationOutputMapAssumeTotal(const StorePath & path) { - auto resp = queryDerivationOutputMap(path); +OutputPathMap Store::queryDerivationOutputMap(const StorePath & path) { + auto resp = queryPartialDerivationOutputMap(path); OutputPathMap result; for (auto & [outName, optOutPath] : resp) { if (!optOutPath) @@ -379,7 +379,7 @@ OutputPathMap Store::queryDerivationOutputMapAssumeTotal(const StorePath & path) StorePathSet Store::queryDerivationOutputs(const StorePath & path) { - auto outputMap = this->queryDerivationOutputMapAssumeTotal(path); + auto outputMap = this->queryDerivationOutputMap(path); StorePathSet outputPaths; for (auto & i: outputMap) { outputPaths.emplace(std::move(i.second)); diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 58e9b16c6..6583413a6 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -348,12 +348,12 @@ public: /* Query the mapping outputName => outputPath for the given derivation. All outputs are mentioned so ones mising the mapping are mapped to `std::nullopt`. */ - virtual std::map<std::string, std::optional<StorePath>> queryDerivationOutputMap(const StorePath & path) - { unsupported("queryDerivationOutputMap"); } + virtual std::map<std::string, std::optional<StorePath>> queryPartialDerivationOutputMap(const StorePath & path) + { unsupported("queryPartialDerivationOutputMap"); } /* Query the mapping outputName=>outputPath for the given derivation. Assume every output has a mapping and throw an exception otherwise. */ - OutputPathMap queryDerivationOutputMapAssumeTotal(const StorePath & path); + OutputPathMap queryDerivationOutputMap(const StorePath & path); /* Query the full store path given the hash part of a valid store path, or empty if the path doesn't exist. */ |