From ce92d1bf1434562f5b80320c503768c4d06f1f8d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Nov 2003 11:22:29 +0000 Subject: * "Nix expression" -> "store expression". * More refactoring. --- src/fix-ng/primops.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/fix-ng/primops.cc') diff --git a/src/fix-ng/primops.cc b/src/fix-ng/primops.cc index 86b364c30f53..097933115342 100644 --- a/src/fix-ng/primops.cc +++ b/src/fix-ng/primops.cc @@ -13,22 +13,22 @@ Expr primImport(EvalState & state, Expr arg) } -static PathSet nixExprRootsCached(EvalState & state, const Path & nePath) +static PathSet storeExprRootsCached(EvalState & state, const Path & nePath) { DrvPaths::iterator i = state.drvPaths.find(nePath); if (i != state.drvPaths.end()) return i->second; else { - PathSet paths = nixExprRoots(nePath); + PathSet paths = storeExprRoots(nePath); state.drvPaths[nePath] = paths; return paths; } } -static Hash hashDerivation(EvalState & state, NixExpr ne) +static Hash hashDerivation(EvalState & state, StoreExpr ne) { - if (ne.type == NixExpr::neDerivation) { + if (ne.type == StoreExpr::neDerivation) { PathSet inputs2; for (PathSet::iterator i = ne.derivation.inputs.begin(); i != ne.derivation.inputs.end(); i++) @@ -40,7 +40,7 @@ static Hash hashDerivation(EvalState & state, NixExpr ne) } ne.derivation.inputs = inputs2; } - return hashTerm(unparseNixExpr(ne)); + return hashTerm(unparseStoreExpr(ne)); } @@ -50,13 +50,13 @@ static Path copyAtom(EvalState & state, const Path & srcPath) Path dstPath(addToStore(srcPath)); ClosureElem elem; - NixExpr ne; - ne.type = NixExpr::neClosure; + StoreExpr ne; + ne.type = StoreExpr::neClosure; ne.closure.roots.insert(dstPath); ne.closure.elems[dstPath] = elem; Hash drvHash = hashDerivation(state, ne); - Path drvPath = writeTerm(unparseNixExpr(ne), ""); + Path drvPath = writeTerm(unparseStoreExpr(ne), ""); state.drvHashes[drvPath] = drvHash; printMsg(lvlChatty, format("copied `%1%' -> closure `%2%'") @@ -66,9 +66,9 @@ static Path copyAtom(EvalState & state, const Path & srcPath) static string addInput(EvalState & state, - Path & nePath, NixExpr & ne) + Path & nePath, StoreExpr & ne) { - PathSet paths = nixExprRootsCached(state, nePath); + PathSet paths = storeExprRootsCached(state, nePath); if (paths.size() != 1) abort(); Path path = *(paths.begin()); ne.derivation.inputs.insert(nePath); @@ -76,7 +76,7 @@ static string addInput(EvalState & state, } -static string processBinding(EvalState & state, Expr e, NixExpr & ne) +static string processBinding(EvalState & state, Expr e, StoreExpr & ne) { e = evalExpr(state, e); @@ -131,8 +131,8 @@ Expr primDerivation(EvalState & state, Expr args) queryAllAttrs(args, attrs); /* Build the derivation expression by processing the attributes. */ - NixExpr ne; - ne.type = NixExpr::neDerivation; + StoreExpr ne; + ne.type = StoreExpr::neDerivation; string drvName; Path outPath; @@ -198,7 +198,7 @@ Expr primDerivation(EvalState & state, Expr args) Hash drvHash = outHashGiven ? hashString((string) outHash + outPath) : hashDerivation(state, ne); - Path drvPath = writeTerm(unparseNixExpr(ne), "-d-" + drvName); + Path drvPath = writeTerm(unparseStoreExpr(ne), "-d-" + drvName); state.drvHashes[drvPath] = drvHash; printMsg(lvlChatty, format("instantiated `%1%' -> `%2%'") -- cgit 1.4.1