diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-25T11·18+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-25T11·18+0000 |
commit | 52bf9b86bb79369b7f7b5b8a5726b83ee154da6a (patch) | |
tree | cda06cd7d3bb5d8d3a62a6881533a36860c7acfb /src/nix-store/main.cc | |
parent | 80faa2f98af8616ab89ac2af63431b887a84fb32 (diff) |
* In nix-store: added query `--referers-closure' that returns the
closure of the referers relation rather than the references relation, i.e., the set of all paths that directly or indirectly refer to the given path. Note that contrary to the references closure this set is not fixed; it can change as paths are added to or removed from the store.
Diffstat (limited to 'src/nix-store/main.cc')
-rw-r--r-- | src/nix-store/main.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc index addf9c7d0d67..dc7a6de8b8ec 100644 --- a/src/nix-store/main.cc +++ b/src/nix-store/main.cc @@ -96,7 +96,8 @@ static void printPathSet(const PathSet & paths) /* Perform various sorts of queries. */ static void opQuery(Strings opFlags, Strings opArgs) { - enum { qOutputs, qRequisites, qReferences, qReferers, qGraph } query = qOutputs; + enum { qOutputs, qRequisites, qReferences, qReferers, + qReferersClosure, qGraph } query = qOutputs; bool useOutput = false; bool includeOutputs = false; bool forceRealise = false; @@ -107,6 +108,7 @@ static void opQuery(Strings opFlags, Strings opArgs) else if (*i == "--requisites" || *i == "-R") query = qRequisites; else if (*i == "--references") query = qReferences; else if (*i == "--referers") query = qReferers; + else if (*i == "--referers-closure") query = qReferersClosure; else if (*i == "--graph") query = qGraph; else if (*i == "--use-output" || *i == "-u") useOutput = true; else if (*i == "--force-realise" || *i == "-f") forceRealise = true; @@ -128,7 +130,8 @@ static void opQuery(Strings opFlags, Strings opArgs) case qRequisites: case qReferences: - case qReferers: { + case qReferers: + case qReferersClosure: { PathSet paths; for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); i++) @@ -138,6 +141,7 @@ static void opQuery(Strings opFlags, Strings opArgs) storePathRequisites(path, includeOutputs, paths); else if (query == qReferences) queryReferences(path, paths); else if (query == qReferers) queryReferers(path, paths); + else if (query == qReferersClosure) computeFSClosure(path, paths, true); } printPathSet(paths); break; |