From 03427e76f11fe1d918020d28bdb69b2fb348ee96 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Aug 2008 11:44:50 +0000 Subject: * querySubstitutablePathInfo: work properly when run via the daemon. * --dry-run: print the paths that we don't know how to build/substitute. --- src/nix-env/nix-env.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index f561dc2e514c..ee870f690668 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); } } -- cgit 1.4.1