1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

nix: Support the --repair flag

This commit is contained in:
Eelco Dolstra 2023-04-28 16:57:37 +02:00
parent 89d3cc5a47
commit 17e6b85d05
7 changed files with 28 additions and 17 deletions

View file

@ -1391,7 +1391,6 @@ static int main_nix_env(int argc, char * * argv)
Operation op = 0;
std::string opName;
bool showHelp = false;
RepairFlag repair = NoRepair;
std::string file;
Globals globals;
@ -1489,8 +1488,6 @@ static int main_nix_env(int argc, char * * argv)
globals.instSource.systemFilter = getArg(*arg, arg, end);
else if (*arg == "--prebuilt-only" || *arg == "-b")
globals.prebuiltOnly = true;
else if (*arg == "--repair")
repair = Repair;
else if (*arg != "" && arg->at(0) == '-') {
opFlags.push_back(*arg);
/* FIXME: hacky */
@ -1515,7 +1512,7 @@ static int main_nix_env(int argc, char * * argv)
auto store = openStore();
globals.state = std::shared_ptr<EvalState>(new EvalState(myArgs.searchPath, store));
globals.state->repair = repair;
globals.state->repair = myArgs.repair;
globals.instSource.nixExprPath = std::make_shared<SourcePath>(
file != ""