* `nix-store -q --hash' to quickly query the hash of the contents of a

store path (which is stored in the database).
This commit is contained in:
Eelco Dolstra 2005-03-02 15:57:06 +00:00
parent 9e50e648a4
commit 07b4399fb6
3 changed files with 28 additions and 6 deletions

View file

@ -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)

View file

@ -89,6 +89,9 @@ void canonicalisePathMetaData(const Path & path);
/* Checks whether a path is valid. */
bool isValidPath(const Path & path);
/* Queries the hash of a valid path. */
Hash queryPathHash(const Path & path);
/* Sets the set of outgoing FS references for a store path. Use with
care! */
void setReferences(const Transaction & txn, const Path & storePath,