about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index e969a3b71e33..aef55f5c9beb 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -104,12 +104,13 @@ static PathSet realisePath(const Path & path, bool build = true)
 static void opRealise(Strings opFlags, Strings opArgs)
 {
     bool dryRun = false;
-    bool repair = false;
+    BuildMode buildMode = bmNormal;
     bool ignoreUnknown = false;
 
     foreach (Strings::iterator, i, opFlags)
         if (*i == "--dry-run") dryRun = true;
-        else if (*i == "--repair") repair = true;
+        else if (*i == "--repair") buildMode = bmRepair;
+        else if (*i == "--check") buildMode = bmCheck;
         else if (*i == "--ignore-unknown") ignoreUnknown = true;
         else throw UsageError(format("unknown flag `%1%'") % *i);
 
@@ -137,7 +138,7 @@ static void opRealise(Strings opFlags, Strings opArgs)
     if (dryRun) return;
 
     /* Build all paths at the same time to exploit parallelism. */
-    store->buildPaths(PathSet(paths.begin(), paths.end()), repair);
+    store->buildPaths(PathSet(paths.begin(), paths.end()), buildMode);
 
     if (!ignoreUnknown)
         foreach (Paths::iterator, i, paths) {