From 3c92ea399d717dc45b3fa91424c0dadc0239ebf2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 2 Aug 2008 12:54:35 +0000 Subject: * Make nix-env --dry-run print the paths to be substituted correctly again. (After the previous substituter mechanism refactoring I didn't update the code that obtains the references of substitutable paths.) This required some refactoring: the substituter programs are now kept running and receive/respond to info requests via stdin/stdout. --- src/libstore/local-store.hh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 1957b9f57948..f096bdd8557a 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -3,6 +3,8 @@ #include +#include + #include "store-api.hh" #include "util.hh" @@ -34,11 +36,26 @@ struct OptimiseStats }; +typedef __gnu_cxx::stdio_filebuf stdio_filebuf; + + +struct RunningSubstituter +{ + Pid pid; + boost::shared_ptr toBuf, fromBuf; + boost::shared_ptr to; + boost::shared_ptr from; +}; + + class LocalStore : public StoreAPI { private: bool substitutablePathsLoaded; PathSet substitutablePaths; + + typedef std::map RunningSubstituters; + RunningSubstituters runningSubstituters; public: @@ -65,6 +82,9 @@ public: PathSet querySubstitutablePaths(); bool hasSubstitutes(const Path & path); + + bool querySubstitutablePathInfo(const Path & path, + SubstitutablePathInfo & info); Path addToStore(const Path & srcPath, bool fixed = false, bool recursive = false, string hashAlgo = "", @@ -147,6 +167,9 @@ private: void tryToDelete(const GCOptions & options, GCResults & results, const PathSet & livePaths, const PathSet & tempRootsClosed, PathSet & done, const Path & path); + + void startSubstituter(const Path & substituter, + RunningSubstituter & runningSubstituter); }; -- cgit 1.4.1