nix-store --clear-failed-paths: Clear derivation outputs

If the argument to ‘nix-store --clear-failed-paths’ is a derivation,
then clear the failed state of its outputs.
This commit is contained in:
Eelco Dolstra 2012-03-20 18:23:26 +01:00
parent cb79e91ec3
commit 19d9762ad5

View file

@ -377,8 +377,10 @@ void LocalStore::openDB(bool create)
"select time from FailedPaths where path = ?;"); "select time from FailedPaths where path = ?;");
stmtQueryFailedPaths.create(db, stmtQueryFailedPaths.create(db,
"select path from FailedPaths;"); "select path from FailedPaths;");
// If the path is a derivation, then clear its outputs.
stmtClearFailedPath.create(db, stmtClearFailedPath.create(db,
"delete from FailedPaths where ?1 = '*' or path = ?1;"); "delete from FailedPaths where ?1 = '*' or path = ?1 "
"or path in (select d.path from DerivationOutputs d join ValidPaths v on d.drv = v.id where v.path = ?1);");
stmtAddDerivationOutput.create(db, stmtAddDerivationOutput.create(db,
"insert or replace into DerivationOutputs (drv, id, path) values (?, ?, ?);"); "insert or replace into DerivationOutputs (drv, id, path) values (?, ?, ?);");
stmtQueryValidDerivers.create(db, stmtQueryValidDerivers.create(db,