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/nix/dotgraph.cc | 8 ++++---- src/nix/dotgraph.hh | 2 +- src/nix/nix-help.txt | 4 ++-- src/nix/nix.cc | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'src/nix') diff --git a/src/nix/dotgraph.cc b/src/nix/dotgraph.cc index 36daf7f9966d..c670bf19e4c5 100644 --- a/src/nix/dotgraph.cc +++ b/src/nix/dotgraph.cc @@ -52,7 +52,7 @@ string pathLabel(const Path & nePath, const string & elemPath) } -void printClosure(const Path & nePath, const NixExpr & fs) +void printClosure(const Path & nePath, const StoreExpr & fs) { PathSet workList(fs.closure.roots); PathSet doneSet; @@ -100,11 +100,11 @@ void printDotGraph(const PathSet & roots) if (doneSet.find(nePath) == doneSet.end()) { doneSet.insert(nePath); - NixExpr ne = exprFromPath(nePath); + StoreExpr ne = storeExprFromPath(nePath); string label, colour; - if (ne.type == NixExpr::neDerivation) { + if (ne.type == StoreExpr::neDerivation) { for (PathSet::iterator i = ne.derivation.inputs.begin(); i != ne.derivation.inputs.end(); i++) { @@ -119,7 +119,7 @@ void printDotGraph(const PathSet & roots) if (i->first == "name") label = i->second; } - else if (ne.type == NixExpr::neClosure) { + else if (ne.type == StoreExpr::neClosure) { label = ""; colour = "#00ffff"; printClosure(nePath, ne); diff --git a/src/nix/dotgraph.hh b/src/nix/dotgraph.hh index a5c5248f144e..ef389b30d353 100644 --- a/src/nix/dotgraph.hh +++ b/src/nix/dotgraph.hh @@ -1,7 +1,7 @@ #ifndef __DOTGRAPH_H #define __DOTGRAPH_H -#include "expr.hh" +#include "storeexpr.hh" void printDotGraph(const PathSet & roots); diff --git a/src/nix/nix-help.txt b/src/nix/nix-help.txt index bf2afd061205..a2d9958ffe49 100644 --- a/src/nix/nix-help.txt +++ b/src/nix/nix-help.txt @@ -2,7 +2,7 @@ nix [OPTIONS...] [ARGUMENTS...] Operations: - --install / -i: realise a Nix expression + --realise / -r: realise a Nix expression --delete / -d: delete paths from the Nix store --add / -A: copy a path to the Nix store --query / -q: query information @@ -22,7 +22,7 @@ Operations: Query flags: --list / -l: query the output paths (roots) of a Nix expression (default) - --requisites / -r: print all paths necessary to realise expression + --requisites / -R: print all paths necessary to realise expression --predecessors: print predecessors of a Nix expression --graph: print a dot graph rooted at given ids diff --git a/src/nix/nix.cc b/src/nix/nix.cc index 1875689990a4..d1766de39b7e 100644 --- a/src/nix/nix.cc +++ b/src/nix/nix.cc @@ -27,15 +27,15 @@ static Path checkPath(const Path & arg) } -/* Realise (or install) paths from the given Nix expressions. */ -static void opInstall(Strings opFlags, Strings opArgs) +/* Realise paths from the given store expressions. */ +static void opRealise(Strings opFlags, Strings opArgs) { if (!opFlags.empty()) throw UsageError("unknown flag"); for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); i++) { - Path nfPath = normaliseNixExpr(checkPath(*i)); + Path nfPath = normaliseStoreExpr(checkPath(*i)); realiseClosure(nfPath); cout << format("%1%\n") % (string) nfPath; } @@ -66,7 +66,7 @@ static void opAdd(Strings opFlags, Strings opArgs) Path maybeNormalise(const Path & ne, bool normalise) { - return normalise ? normaliseNixExpr(ne) : ne; + return normalise ? normaliseStoreExpr(ne) : ne; } @@ -82,7 +82,7 @@ static void opQuery(Strings opFlags, Strings opArgs) for (Strings::iterator i = opFlags.begin(); i != opFlags.end(); i++) if (*i == "--list" || *i == "-l") query = qList; - else if (*i == "--requisites" || *i == "-r") query = qRequisites; + else if (*i == "--requisites" || *i == "-R") query = qRequisites; else if (*i == "--predecessors") query = qPredecessors; else if (*i == "--graph") query = qGraph; else if (*i == "--normalise" || *i == "-n") normalise = true; @@ -96,7 +96,7 @@ static void opQuery(Strings opFlags, Strings opArgs) for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); i++) { - StringSet paths = nixExprRoots( + StringSet paths = storeExprRoots( maybeNormalise(checkPath(*i), normalise)); for (StringSet::iterator j = paths.begin(); j != paths.end(); j++) @@ -110,7 +110,7 @@ static void opQuery(Strings opFlags, Strings opArgs) for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); i++) { - StringSet paths2 = nixExprRequisites( + StringSet paths2 = storeExprRequisites( maybeNormalise(checkPath(*i), normalise), includeExprs, includeSuccessors); paths.insert(paths2.begin(), paths2.end()); @@ -258,8 +258,8 @@ void run(Strings args) Operation oldOp = op; - if (arg == "--install" || arg == "-i") - op = opInstall; + if (arg == "--realise" || arg == "-r") + op = opRealise; else if (arg == "--delete" || arg == "-d") op = opDelete; else if (arg == "--add" || arg == "-A") -- cgit 1.4.1