diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-04-25T09·20+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-04-25T09·20+0200 |
commit | bcecc990071fd36bb88c8fd29cb009ed4c04d6a2 (patch) | |
tree | c3f2fa86b2d751418efe7727bc345d0557c3786c /src/nix/run.cc | |
parent | 1bb87c0487ba2a10f20c07dfd828b5d043249e31 (diff) |
Restructure installables handling in the "nix" command
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r-- | src/nix/run.cc | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc index a30031ad07b4..f3333b777805 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -13,7 +13,7 @@ using namespace nix; -struct CmdRun : StoreCommand, MixInstallables +struct CmdRun : MixInstallables { CmdRun() { @@ -31,20 +31,7 @@ struct CmdRun : StoreCommand, MixInstallables void run(ref<Store> store) override { - auto elems = evalInstallables(store); - - PathSet pathsToBuild; - - for (auto & elem : elems) { - if (elem.isDrv) - pathsToBuild.insert(elem.drvPath); - else - pathsToBuild.insert(elem.outPaths.begin(), elem.outPaths.end()); - } - - printMissing(store, pathsToBuild); - - store->buildPaths(pathsToBuild); + auto paths = buildInstallables(store, false); auto store2 = store.dynamic_pointer_cast<LocalStore>(); @@ -104,7 +91,7 @@ struct CmdRun : StoreCommand, MixInstallables } PathSet outPaths; - for (auto & path : pathsToBuild) + for (auto & path : paths) if (isDerivation(path)) { Derivation drv = store->derivationFromPath(path); for (auto & output : drv.outputs) |