From 19d9762ad5fc8d8db3e9a545a89309f08572cc9f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Mar 2012 18:23:26 +0100 Subject: [PATCH] nix-store --clear-failed-paths: Clear derivation outputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the argument to ‘nix-store --clear-failed-paths’ is a derivation, then clear the failed state of its outputs. --- src/libstore/local-store.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 231640ead..f3b779dd0 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,