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

@ -84,7 +84,6 @@ static void main_nix_build(int argc, char * * argv)
auto interactive = isatty(STDIN_FILENO) && isatty(STDERR_FILENO);
Strings attrPaths;
Strings left;
RepairFlag repair = NoRepair;
BuildMode buildMode = bmNormal;
bool readStdin = false;
@ -169,11 +168,6 @@ static void main_nix_build(int argc, char * * argv)
else if (*arg == "--dry-run")
dryRun = true;
else if (*arg == "--repair") {
repair = Repair;
buildMode = bmRepair;
}
else if (*arg == "--run-env") // obsolete
runEnv = true;
@ -249,7 +243,8 @@ static void main_nix_build(int argc, char * * argv)
auto evalStore = myArgs.evalStoreUrl ? openStore(*myArgs.evalStoreUrl) : store;
auto state = std::make_unique<EvalState>(myArgs.searchPath, evalStore, store);
state->repair = repair;
state->repair = myArgs.repair;
if (myArgs.repair) buildMode = bmRepair;
auto autoArgs = myArgs.getAutoArgs(*state);