From ebff82222c7b946e70e539389c0027529b6c7ad0 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 15 Oct 2003 12:42:39 +0000 Subject: * Refactoring: move all database manipulation into store.cc. * Removed `--query --generators'. --- src/nix.cc | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/nix.cc') 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(); ) { -- cgit v1.2.3