From a824d58b566752b2a89a718fd628053754968d72 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Dec 2006 20:51:18 +0000 Subject: * Merge addToStore and addToStoreFixed. * addToStore now adds unconditionally, it doesn't use readOnlyMode. Read-only operation is up to the caller (who can call computeStorePathForPath). --- src/libstore/local-store.hh | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index e41e4368397f..3a7b22048e4d 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -45,27 +45,19 @@ public: Hash queryPathHash(const Path & path); - void queryReferences(const Path & storePath, - PathSet & references); + void queryReferences(const Path & path, PathSet & references); - void queryReferrers(const Path & storePath, - PathSet & referrers); + void queryReferrers(const Path & path, PathSet & referrers); - Path addToStore(const Path & srcPath); - - Path addToStoreFixed(bool recursive, string hashAlgo, - const Path & srcPath); + Path addToStore(const Path & srcPath, bool fixed = false, + bool recursive = false, string hashAlgo = ""); Path addTextToStore(const string & suffix, const string & s, const PathSet & references); void buildDerivations(const PathSet & drvPaths); - void ensurePath(const Path & storePath); - -private: - Path _addToStore(bool fixed, bool recursive, - string hashAlgo, const Path & _srcPath); + void ensurePath(const Path & path); }; @@ -120,16 +112,16 @@ bool isValidPathTxn(const Transaction & txn, 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, +void setReferences(const Transaction & txn, const Path & path, const PathSet & references); /* Sets the deriver of a store path. Use with care! */ -void setDeriver(const Transaction & txn, const Path & storePath, +void setDeriver(const Transaction & txn, const Path & path, 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); +Path queryDeriver(const Transaction & txn, const Path & path); /* Delete a value from the nixStore directory. */ void deleteFromStore(const Path & path, unsigned long long & bytesFreed); -- cgit 1.4.1