1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Move addPermRoot into Store

This commit is contained in:
Eelco Dolstra 2016-02-11 16:14:42 +01:00
parent fd205fb6f8
commit ae4a3cfa03
5 changed files with 15 additions and 16 deletions

View file

@ -32,7 +32,7 @@ static bool indirectRoot = false;
enum OutputKind { okPlain, okXML, okJSON };
void processExpr(ref<Store> store, EvalState & state, const Strings & attrPaths,
void processExpr(EvalState & state, const Strings & attrPaths,
bool parseOnly, bool strict, Bindings & autoArgs,
bool evalOnly, OutputKind output, bool location, Expr * e)
{
@ -79,7 +79,7 @@ void processExpr(ref<Store> store, EvalState & state, const Strings & attrPaths,
else {
Path rootName = gcRoot;
if (++rootNr > 1) rootName += "-" + std::to_string(rootNr);
drvPath = addPermRoot(store, drvPath, rootName, indirectRoot);
drvPath = state.store->addPermRoot(drvPath, rootName, indirectRoot);
}
std::cout << format("%1%%2%\n") % drvPath % (outputName != "out" ? "!" + outputName : "");
}
@ -177,7 +177,7 @@ int main(int argc, char * * argv)
if (readStdin) {
Expr * e = parseStdin(state);
processExpr(store, state, attrPaths, parseOnly, strict, autoArgs,
processExpr(state, attrPaths, parseOnly, strict, autoArgs,
evalOnly, outputKind, xmlOutputSourceLocation, e);
} else if (files.empty() && !fromArgs)
files.push_back("./default.nix");
@ -186,7 +186,7 @@ int main(int argc, char * * argv)
Expr * e = fromArgs
? state.parseExprFromString(i, absPath("."))
: state.parseExprFromFile(resolveExprPath(lookupFileArg(state, i)));
processExpr(store, state, attrPaths, parseOnly, strict, autoArgs,
processExpr(state, attrPaths, parseOnly, strict, autoArgs,
evalOnly, outputKind, xmlOutputSourceLocation, e);
}