about summary refs log tree commit diff
path: root/src/nix/command.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-25T14·19+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-25T14·19+0200
commitc30330df6f67c81986dfb124631bc756c8e58c0d (patch)
treeae398eedf65b06cba340292893afce6a041e7299 /src/nix/command.cc
parentd48c973ece20875391bebde3c167d6e0cc1e666e (diff)
StorePathCommands: Build installables
So for instance "nix copy --to ... nixpkgs.hello" will build
nixpkgs.hello first. It's debatable whether this is a good idea. It
seems desirable for commands like "nix copy" but maybe not for
commands like "nix path-info".
Diffstat (limited to 'src/nix/command.cc')
-rw-r--r--src/nix/command.cc12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/nix/command.cc b/src/nix/command.cc
index 2809a9b4f288..a45f2888bfb5 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -115,16 +115,8 @@ void StorePathsCommand::run(ref<Store> store)
     }
 
     else {
-        for (auto & i : installables) {
-            for (auto & path : i->toBuildable()) {
-                if (isDerivation(path)) {
-                    Derivation drv = store->derivationFromPath(path);
-                    for (auto & output : drv.outputs)
-                        storePaths.push_back(output.second.path);
-                } else
-                    storePaths.push_back(path);
-            }
-        }
+        for (auto & p : buildInstallables(store, false))
+            storePaths.push_back(p);
 
         if (recursive) {
             PathSet closure;