From 450c358e2055488897349bf50951cce16ad9bc90 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 7 Feb 2005 13:40:40 +0000 Subject: * Maintain a database table (`derivers') that maps output paths to the derivation that produced them. * `nix-store -qd PATH' prints out the derivation that produced a path. --- src/libstore/store.hh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/libstore/store.hh') diff --git a/src/libstore/store.hh b/src/libstore/store.hh index 3a0b7a7131a2..95c738ed1bcc 100644 --- a/src/libstore/store.hh +++ b/src/libstore/store.hh @@ -57,7 +57,8 @@ void clearSubstitutes(); of the file system contents of the path. The hash must be a SHA-256 hash. */ void registerValidPath(const Transaction & txn, - const Path & path, const Hash & hash, const PathSet & references); + const Path & path, const Hash & hash, const PathSet & references, + const Path & deriver); /* Throw an exception if `path' is not directly in the Nix store. */ void assertStorePath(const Path & path); @@ -77,7 +78,8 @@ void canonicalisePathMetaData(const Path & path); /* Checks whether a path is valid. */ bool isValidPath(const Path & path); -/* Sets the set of outgoing FS references for a store path. */ +/* Sets the set of outgoing FS references for a store path. Use with + care! */ void setReferences(const Transaction & txn, const Path & storePath, const PathSet & references); @@ -89,6 +91,14 @@ void queryReferences(const Path & storePath, PathSet & references); result is not cleared. */ void queryReferers(const Path & storePath, PathSet & referers); +/* Sets the deriver of a store path. Use with care! */ +void setDeriver(const Transaction & txn, const Path & storePath, + const Path & deriver); + +/* Query the deriver of a store path. Return the empty string if no + deriver has been set. */ +Path queryDeriver(const Transaction & txn, const Path & storePath); + /* Constructs a unique store path name. */ Path makeStorePath(const string & type, const Hash & hash, const string & suffix); -- cgit 1.4.1