* Added a command `nix-store --clear-failed-paths <PATHS>' to clear
the "failed" status of the given store paths. The special value `*' clears all failed paths.
This commit is contained in:
parent
2398af13c5
commit
6199f9b93e
3 changed files with 33 additions and 1 deletions
|
|
@ -329,6 +329,8 @@ void LocalStore::openDB(bool create)
|
|||
"select time from FailedPaths where path = ?;");
|
||||
stmtQueryFailedPaths.create(db,
|
||||
"select path from FailedPaths;");
|
||||
stmtClearFailedPath.create(db,
|
||||
"delete from FailedPaths where ?1 = '*' or path = ?1;");
|
||||
stmtAddDerivationOutput.create(db,
|
||||
"insert or replace into DerivationOutputs (drv, id, path) values (?, ?, ?);");
|
||||
stmtQueryValidDerivers.create(db,
|
||||
|
|
@ -529,6 +531,21 @@ PathSet LocalStore::queryFailedPaths()
|
|||
}
|
||||
|
||||
|
||||
void LocalStore::clearFailedPaths(const PathSet & paths)
|
||||
{
|
||||
SQLiteTxn txn(db);
|
||||
|
||||
foreach (PathSet::const_iterator, i, paths) {
|
||||
SQLiteStmtUse use(stmtClearFailedPath);
|
||||
stmtClearFailedPath.bind(*i);
|
||||
if (sqlite3_step(stmtClearFailedPath) != SQLITE_DONE)
|
||||
throw SQLiteError(db, format("clearing failed path `%1%' in database") % *i);
|
||||
}
|
||||
|
||||
txn.commit();
|
||||
}
|
||||
|
||||
|
||||
Hash parseHashField(const Path & path, const string & s)
|
||||
{
|
||||
string::size_type colon = s.find(':');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue