1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

* 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:
Eelco Dolstra 2010-04-26 12:56:42 +00:00
parent 2398af13c5
commit 6199f9b93e
3 changed files with 33 additions and 1 deletions

View file

@ -666,7 +666,7 @@ static void opOptimise(Strings opFlags, Strings opArgs)
}
static void opQueryFailedPaths(Strings opFlags, Strings opArgs)
static void opQueryFailedPaths(Strings opFlags, Strings opArgs)
{
if (!opArgs.empty() || !opFlags.empty())
throw UsageError("no arguments expected");
@ -676,6 +676,14 @@ static void opQueryFailedPaths(Strings opFlags, Strings opArgs)
}
static void opClearFailedPaths(Strings opFlags, Strings opArgs)
{
if (!opFlags.empty())
throw UsageError("no flags expected");
ensureLocalStore().clearFailedPaths(PathSet(opArgs.begin(), opArgs.end()));
}
/* Scan the arguments; find the operation, set global flags, put all
other flags in a list, and put all other arguments in another
list. */
@ -729,6 +737,8 @@ void run(Strings args)
op = opOptimise;
else if (arg == "--query-failed-paths")
op = opQueryFailedPaths;
else if (arg == "--clear-failed-paths")
op = opClearFailedPaths;
else if (arg == "--add-root") {
if (i == args.end())
throw UsageError("`--add-root requires an argument");