From af2e53fd481994cca46b9c003a6a8eae50cf951c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 6 Nov 2011 06:28:20 +0000 Subject: Include all outputs of derivations in the closure of explicitly-passed derivation paths This required adding a queryOutputDerivationNames function in the store API --- src/libstore/local-store.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 702ff67e79..8ca5daa9f1 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; -- cgit 1.4.1