diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-09-15 14:08:35 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-09-15 14:08:35 +0000 |
commit | c08c9f08c75bf379439348cccb5b8871a27bf498 (patch) | |
tree | c4a7276366b31047b9f437865bebe21a919382af /src/libstore/local-store.cc | |
parent | 3df78858f2ad91a80e30ba910119a0c16c05c66a (diff) | |
parent | 733d2e9402807e54d503c3113e854bfddb3d44e0 (diff) |
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 990810b0e..84f8d7752 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -785,17 +785,21 @@ StorePathSet LocalStore::queryValidDerivers(const StorePath & path) } -OutputPathMap LocalStore::queryDerivationOutputMap(const StorePath & path) +std::map<std::string, std::optional<StorePath>> LocalStore::queryPartialDerivationOutputMap(const StorePath & path) { - return retrySQLite<OutputPathMap>([&]() { + std::map<std::string, std::optional<StorePath>> outputs; + BasicDerivation drv = readDerivation(path); + for (auto & [outName, _] : drv.outputs) { + outputs.insert_or_assign(outName, std::nullopt); + } + return retrySQLite<std::map<std::string, std::optional<StorePath>>>([&]() { auto state(_state.lock()); auto useQueryDerivationOutputs(state->stmtQueryDerivationOutputs.use() (queryValidPathId(*state, path))); - OutputPathMap outputs; while (useQueryDerivationOutputs.next()) - outputs.emplace( + outputs.insert_or_assign( useQueryDerivationOutputs.getStr(0), parseStorePath(useQueryDerivationOutputs.getStr(1)) ); |