about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T13·44+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T13·44+0000
commita1d310b6b5c710215265c1cd0d5893248ed50f92 (patch)
treebf35d52f339ee027fc749bb63cc3d2bbe5a23f49 /src/nix-env/nix-env.cc
parent42043953c3558f054dc5b9bb3da605a4a3ed6314 (diff)
* `nix-store --realise': print what paths will be built/downloaded,
  just like nix-env.
* `nix-store --realise': --dry-run option.

Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index c3fe2d0896..2f2f263f54 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -531,8 +531,8 @@ static void queryInstSources(EvalState & state,
 
 static void printMissing(EvalState & state, const DrvInfos & elems)
 {
-    PathSet targets, willBuild, willSubstitute, unknown;
-    for (DrvInfos::const_iterator i = elems.begin(); i != elems.end(); ++i) {
+    PathSet targets;
+    foreach (DrvInfos::const_iterator, i, elems) {
         Path drvPath = i->queryDrvPath(state);
         if (drvPath != "")
             targets.insert(drvPath);
@@ -540,28 +540,7 @@ static void printMissing(EvalState & state, const DrvInfos & elems)
             targets.insert(i->queryOutPath(state));
     }
 
-    unsigned long long downloadSize;
-    queryMissing(targets, willBuild, willSubstitute, unknown, downloadSize);
-
-    if (!willBuild.empty()) {
-        printMsg(lvlInfo, format("the following derivations will be built:"));
-        foreach (PathSet::iterator, i, willBuild)
-            printMsg(lvlInfo, format("  %1%") % *i);
-    }
-
-    if (!willSubstitute.empty()) {
-        printMsg(lvlInfo, format("the following paths will be downloaded/copied (%.2f MiB):") %
-            (downloadSize / (1024.0 * 1024.0)));
-        foreach (PathSet::iterator, i, willSubstitute)
-            printMsg(lvlInfo, format("  %1%") % *i);
-    }
-
-    if (!unknown.empty()) {
-        printMsg(lvlInfo, format("don't know how to build the following paths%1%:")
-            % (readOnlyMode ? " (may be caused by read-only store access)" : ""));
-        foreach (PathSet::iterator, i, unknown)
-            printMsg(lvlInfo, format("  %1%") % *i);
-    }
+    printMissing(targets);
 }