Skip to content

Commit

Permalink
nix-store --clear-failed-paths: Clear derivation outputs
Browse files Browse the repository at this point in the history
If the argument to ‘nix-store --clear-failed-paths’ is a derivation,
then clear the failed state of its outputs.
  • Loading branch information
edolstra committed Mar 20, 2012
1 parent cb79e91 commit 19d9762
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libstore/local-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,10 @@ void LocalStore::openDB(bool create)
"select time from FailedPaths where path = ?;");
stmtQueryFailedPaths.create(db,
"select path from FailedPaths;");
// If the path is a derivation, then clear its outputs.
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,
"insert or replace into DerivationOutputs (drv, id, path) values (?, ?, ?);");
stmtQueryValidDerivers.create(db,
Expand Down

0 comments on commit 19d9762

Please sign in to comment.