about summary refs log tree commit diff
path: root/src/nix-env/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-11-30T22·43+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-11-30T22·43+0000
commit0565b5f2b35dc153dc98e1e3bd37476aa13ee4f1 (patch)
treea370db3e93b6e07f044fc436092c9d082da9c8be /src/nix-env/main.cc
parentaac547a8b3f481fda48cc1fe1082ce4c32be0e03 (diff)
* More remote operations.
* Added new operation hasSubstitutes(), which is more efficient than
  querySubstitutes().size() > 0.

Diffstat (limited to 'src/nix-env/main.cc')
-rw-r--r--src/nix-env/main.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc
index ce0bef069708..a9f34387079b 100644
--- a/src/nix-env/main.cc
+++ b/src/nix-env/main.cc
@@ -832,18 +832,18 @@ static void opQuery(Globals & globals,
             XMLAttrs attrs;
         
             if (printStatus) {
-                Substitutes subs = store->querySubstitutes(i->queryOutPath(globals.state));
+                bool hasSubs = store->hasSubstitutes(i->queryOutPath(globals.state));
                 bool isInstalled = installed.find(i->queryOutPath(globals.state)) != installed.end();
                 bool isValid = store->isValidPath(i->queryOutPath(globals.state));
                 if (xmlOutput) {
                     attrs["installed"] = isInstalled ? "1" : "0";
                     attrs["valid"] = isValid ? "1" : "0";
-                    attrs["substitutable"] = !subs.empty() ? "1" : "0";
+                    attrs["substitutable"] = hasSubs ? "1" : "0";
                 } else
                     columns.push_back(
                         (string) (isInstalled ? "I" : "-")
                         + (isValid ? "P" : "-")
-                        + (!subs.empty() ? "S" : "-"));
+                        + (hasSubs ? "S" : "-"));
             }
 
             if (xmlOutput)