diff options
Diffstat (limited to 'src/nix-store')
-rw-r--r-- | src/nix-store/main.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc index d473475b821a..4b8d2cf3f75c 100644 --- a/src/nix-store/main.cc +++ b/src/nix-store/main.cc @@ -162,7 +162,7 @@ static void printPathSet(const PathSet & paths) static void opQuery(Strings opFlags, Strings opArgs) { enum { qOutputs, qRequisites, qReferences, qReferers, - qReferersClosure, qGraph } query = qOutputs; + qReferersClosure, qDeriver, qGraph } query = qOutputs; bool useOutput = false; bool includeOutputs = false; bool forceRealise = false; @@ -174,6 +174,7 @@ static void opQuery(Strings opFlags, Strings opArgs) else if (*i == "--references") query = qReferences; else if (*i == "--referers") query = qReferers; else if (*i == "--referers-closure") query = qReferersClosure; + else if (*i == "--deriver" || *i == "-d") query = qDeriver; else if (*i == "--graph") query = qGraph; else if (*i == "--use-output" || *i == "-u") useOutput = true; else if (*i == "--force-realise" || *i == "-f") forceRealise = true; @@ -214,6 +215,18 @@ static void opQuery(Strings opFlags, Strings opArgs) break; } + case qDeriver: + for (Strings::iterator i = opArgs.begin(); + i != opArgs.end(); i++) + { + *i = followSymlinks(*i); + Path deriver = queryDeriver(noTxn, *i); + cout << format("%1%\n") % + (deriver == "" ? "unknown-deriver" : deriver); + } + break; + + #if 0 case qGraph: { PathSet roots; @@ -288,7 +301,7 @@ static void opValidPath(Strings opFlags, Strings opArgs) createStoreTransaction(txn); for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i) - registerValidPath(txn, *i, hashPath(htSHA256, *i), PathSet()); + registerValidPath(txn, *i, hashPath(htSHA256, *i), PathSet(), ""); txn.commit(); } |