aboutsummaryrefslogtreecommitdiff
path: root/src/nix-env
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-env')
-rw-r--r--src/nix-env/nix-env.cc12
-rw-r--r--src/nix-env/user-env.cc2
2 files changed, 6 insertions, 8 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index 2c27d97f5..8b0692035 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -212,9 +212,7 @@ static bool isPrebuilt(EvalState & state, DrvInfo & elem)
{
auto path = state.store->parseStorePath(elem.queryOutPath());
if (state.store->isValidPath(path)) return true;
- StorePathSet paths;
- paths.insert(path.clone()); // FIXME: why doesn't StorePathSet{path.clone()} work?
- return state.store->querySubstitutablePaths(paths).count(path);
+ return state.store->querySubstitutablePaths({path}).count(path);
}
@@ -425,9 +423,9 @@ static void printMissing(EvalState & state, DrvInfos & elems)
for (auto & i : elems) {
Path drvPath = i.queryDrvPath();
if (drvPath != "")
- targets.emplace_back(state.store->parseStorePath(drvPath));
+ targets.push_back({state.store->parseStorePath(drvPath)});
else
- targets.emplace_back(state.store->parseStorePath(i.queryOutPath()));
+ targets.push_back({state.store->parseStorePath(i.queryOutPath())});
}
printMissing(state.store, targets);
@@ -697,13 +695,13 @@ static void opSet(Globals & globals, Strings opFlags, Strings opArgs)
drv.setName(globals.forceName);
if (drv.queryDrvPath() != "") {
- std::vector<StorePathWithOutputs> paths{globals.state->store->parseStorePath(drv.queryDrvPath())};
+ std::vector<StorePathWithOutputs> paths{{globals.state->store->parseStorePath(drv.queryDrvPath())}};
printMissing(globals.state->store, paths);
if (globals.dryRun) return;
globals.state->store->buildPaths(paths, globals.state->repair ? bmRepair : bmNormal);
} else {
printMissing(globals.state->store,
- {globals.state->store->parseStorePath(drv.queryOutPath())});
+ {{globals.state->store->parseStorePath(drv.queryOutPath())}});
if (globals.dryRun) return;
globals.state->store->ensurePath(globals.state->store->parseStorePath(drv.queryOutPath()));
}
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc
index f804b77a0..8e7f09e12 100644
--- a/src/nix-env/user-env.cc
+++ b/src/nix-env/user-env.cc
@@ -134,7 +134,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
/* Realise the resulting store expression. */
debug("building user environment");
std::vector<StorePathWithOutputs> topLevelDrvs;
- topLevelDrvs.push_back(StorePathWithOutputs{topLevelDrv.clone()});
+ topLevelDrvs.push_back({topLevelDrv});
state.store->buildPaths(topLevelDrvs, state.repair ? bmRepair : bmNormal);
/* Switch the current user environment to the output path. */