diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-15 12:42:39 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-15 12:42:39 +0000 |
commit | ebff82222c7b946e70e539389c0027529b6c7ad0 (patch) | |
tree | 4f3352f66c91f6f21ef47b1b07f763f4be0ffeb0 /src/nix.cc | |
parent | 5fc71276430e8e6a4588fa54da692f81d5ada585 (diff) |
* Refactoring: move all database manipulation into store.cc.
* Removed `--query --generators'.
Diffstat (limited to 'src/nix.cc')
-rw-r--r-- | src/nix.cc | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/nix.cc b/src/nix.cc index 1012780af..a4d2898f1 100644 --- a/src/nix.cc +++ b/src/nix.cc @@ -73,7 +73,7 @@ Path maybeNormalise(const Path & ne, bool normalise) /* Perform various sorts of queries. */ static void opQuery(Strings opFlags, Strings opArgs) { - enum { qList, qRequisites, qGenerators, qPredecessors, qGraph + enum { qList, qRequisites, qPredecessors, qGraph } query = qList; bool normalise = false; bool includeExprs = true; @@ -83,7 +83,6 @@ static void opQuery(Strings opFlags, Strings opArgs) i != opFlags.end(); i++) if (*i == "--list" || *i == "-l") query = qList; else if (*i == "--requisites" || *i == "-r") query = qRequisites; - else if (*i == "--generators" || *i == "-g") query = qGenerators; else if (*i == "--predecessors") query = qPredecessors; else if (*i == "--graph") query = qGraph; else if (*i == "--normalise" || *i == "-n") normalise = true; @@ -124,22 +123,6 @@ static void opQuery(Strings opFlags, Strings opArgs) break; } -#if 0 - case qGenerators: { - FSIds outIds; - for (Strings::iterator i = opArgs.begin(); - i != opArgs.end(); i++) - outIds.push_back(checkPath(*i)); - - FSIds genIds = findGenerators(outIds); - - for (FSIds::iterator i = genIds.begin(); - i != genIds.end(); i++) - cout << format("%s\n") % expandId(*i); - break; - } -#endif - case qPredecessors: { for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); i++) @@ -172,7 +155,8 @@ static void opSuccessor(Strings opFlags, Strings opArgs) if (!opFlags.empty()) throw UsageError("unknown flag"); if (opArgs.size() % 2) throw UsageError("expecting even number of arguments"); - Transaction txn(nixDB); /* !!! this could be a big transaction */ + Transaction txn; + createStoreTransaction(txn); for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ) { |