Include all outputs of derivations in the closure of explicitly-passed derivation paths

This required adding a queryOutputDerivationNames function in the store API
This commit is contained in:
Shea Levy 2011-11-06 06:28:20 +00:00
parent 981edeab7b
commit af2e53fd48
8 changed files with 58 additions and 2 deletions

View file

@ -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;