diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-26T12·56+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-26T12·56+0000 |
commit | 6199f9b93ee234139906792c8c1b4908a35df146 (patch) | |
tree | f5ce654e0c5b309e5d81b42f75cb5fa51c10ef6e /src/nix-store | |
parent | 2398af13c53217b5de5821bac0f0c44e9081c23d (diff) |
* 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.
Diffstat (limited to 'src/nix-store')
-rw-r--r-- | src/nix-store/nix-store.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 34bbbcd9f01b..148fd6add48e 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -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"); |