1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 16:41:47 +02:00

Cleanup: Remove singleton()

This commit is contained in:
Eelco Dolstra 2016-05-04 16:04:52 +02:00
parent 0d4a10e910
commit 6c75cf69c3
9 changed files with 23 additions and 35 deletions

View file

@ -224,7 +224,7 @@ static bool isPrebuilt(EvalState & state, DrvInfo & elem)
{
Path path = elem.queryOutPath();
if (state.store->isValidPath(path)) return true;
PathSet ps = state.store->querySubstitutablePaths(singleton<PathSet>(path));
PathSet ps = state.store->querySubstitutablePaths({path});
return ps.find(path) != ps.end();
}
@ -710,13 +710,13 @@ static void opSet(Globals & globals, Strings opFlags, Strings opArgs)
drv.name = globals.forceName;
if (drv.queryDrvPath() != "") {
PathSet paths = singleton<PathSet>(drv.queryDrvPath());
PathSet paths = {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, singleton<PathSet>(drv.queryOutPath()));
printMissing(globals.state->store, {drv.queryOutPath()});
if (globals.dryRun) return;
globals.state->store->ensurePath(drv.queryOutPath());
}

View file

@ -112,7 +112,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
Value args, topLevel;
state.mkAttrs(args, 3);
mkString(*state.allocAttr(args, state.symbols.create("manifest")),
manifestFile, singleton<PathSet>(manifestFile));
manifestFile, {manifestFile});
args.attrs->push_back(Attr(state.symbols.create("derivations"), &manifest));
args.attrs->sort();
mkApp(topLevel, envBuilder, args);
@ -128,7 +128,7 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
/* Realise the resulting store expression. */
debug("building user environment");
state.store->buildPaths(singleton<PathSet>(topLevelDrv), state.repair ? bmRepair : bmNormal);
state.store->buildPaths({topLevelDrv}, state.repair ? bmRepair : bmNormal);
/* Switch the current user environment to the output path. */
PathLocks lock;