about summary refs log tree commit diff
path: root/src/libstore/store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-03-02T15·57+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-03-02T15·57+0000
commit07b4399fb6f04d0cae58b8cf0a13efeeaf9d590b (patch)
treecd35f9205c15098f51c6c11da5148b27e4c7060f /src/libstore/store.cc
parent9e50e648a47c1ef3b734bf12945c8b29a8c8f9f8 (diff)
* `nix-store -q --hash' to quickly query the hash of the contents of a
  store path (which is stored in the database).

Diffstat (limited to 'src/libstore/store.cc')
-rw-r--r--src/libstore/store.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libstore/store.cc b/src/libstore/store.cc
index 946be5e02b..9f50e597eb 100644
--- a/src/libstore/store.cc
+++ b/src/libstore/store.cc
@@ -509,6 +509,14 @@ static Hash queryHash(const Transaction & txn, const Path & storePath)
 }
 
 
+Hash queryPathHash(const Path & path)
+{
+    if (!isValidPath(path))
+        throw Error(format("path `%1%' is not valid") % path);
+    return queryHash(noTxn, path);
+}
+
+
 void registerValidPath(const Transaction & txn,
     const Path & _path, const Hash & hash, const PathSet & references,
     const Path & deriver)