diff options
author | Shea Levy <shea@shealevy.com> | 2011-11-06 06:28:20 +0000 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2011-11-06 06:28:20 +0000 |
commit | af2e53fd481994cca46b9c003a6a8eae50cf951c (patch) | |
tree | a48f614d74b2e5c1e9b9fa91a6f8481f8d874f35 /src/libstore/local-store.cc | |
parent | 981edeab7b6b415c71d3421da6967ec7fc232e54 (diff) |
Include all outputs of derivations in the closure of explicitly-passed derivation paths
This required adding a queryOutputDerivationNames function in the store API
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 702ff67e7..8ca5daa9f 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -820,6 +820,28 @@ PathSet LocalStore::queryDerivationOutputs(const Path & path) } +StringSet LocalStore::queryDerivationOutputNames(const Path & path) +{ + SQLiteTxn txn(db); + + SQLiteStmtUse use(stmtQueryDerivationOutputs); + stmtQueryDerivationOutputs.bind(queryValidPathId(path)); + + StringSet outputNames; + int r; + while ((r = sqlite3_step(stmtQueryDerivationOutputs)) == SQLITE_ROW) { + const char * s = (const char *) sqlite3_column_text(stmtQueryDerivationOutputs, 0); + assert(s); + outputNames.insert(s); + } + + if (r != SQLITE_DONE) + throwSQLiteError(db, format("error getting output names of `%1%'") % path); + + return outputNames; +} + + void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter & run) { if (run.pid != -1) return; |