diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-03-20T17·23+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-03-20T17·23+0100 |
commit | 19d9762ad5fc8d8db3e9a545a89309f08572cc9f (patch) | |
tree | a74fc3a2d33e48240a3516b06d7490e86ff037d2 /src/libstore/local-store.cc | |
parent | cb79e91ec3f63ac46d8f4361cb4db75e76a79981 (diff) |
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.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r-- | src/libstore/local-store.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 231640eadfa2..f3b779dd05f3 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -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, |