about summary refs log tree commit diff
path: root/src/nix-env
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T11·44+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-08-04T11·44+0000
commit03427e76f11fe1d918020d28bdb69b2fb348ee96 (patch)
treea9628150b6c2943e1fa99fd03f7fcf4b30ec7bf4 /src/nix-env
parentb3c26180e33856f16e1e5ceea30b951065b4ebc1 (diff)
* querySubstitutablePathInfo: work properly when run via the daemon.
* --dry-run: print the paths that we don't know how to build/substitute.

Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index f561dc2e51..ee870f6906 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -531,7 +531,7 @@ static void queryInstSources(EvalState & state,
 
 static void printMissing(EvalState & state, const DrvInfos & elems)
 {
-    PathSet targets, willBuild, willSubstitute;
+    PathSet targets, willBuild, willSubstitute, unknown;
     for (DrvInfos::const_iterator i = elems.begin(); i != elems.end(); ++i) {
         Path drvPath = i->queryDrvPath(state);
         if (drvPath != "")
@@ -540,17 +540,24 @@ static void printMissing(EvalState & state, const DrvInfos & elems)
             targets.insert(i->queryOutPath(state));
     }
 
-    queryMissing(targets, willBuild, willSubstitute);
+    queryMissing(targets, willBuild, willSubstitute, unknown);
 
     if (!willBuild.empty()) {
         printMsg(lvlInfo, format("the following derivations will be built:"));
-        for (PathSet::iterator i = willBuild.begin(); i != willBuild.end(); ++i)
+        foreach (PathSet::iterator, i, willBuild)
             printMsg(lvlInfo, format("  %1%") % *i);
     }
 
     if (!willSubstitute.empty()) {
-        printMsg(lvlInfo, format("the following paths will be substituted:"));
-        for (PathSet::iterator i = willSubstitute.begin(); i != willSubstitute.end(); ++i)
+        printMsg(lvlInfo, format("the following paths will be downloaded/copied:"));
+        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);
     }
 }