diff options
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r-- | src/libstore/store-api.hh | 55 |
1 files changed, 22 insertions, 33 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 01b561e9d496..f133302b2f84 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -13,28 +13,6 @@ namespace nix { -/* A substitute is a program invocation that constructs some store - path (typically by fetching it from somewhere, e.g., from the - network). */ -struct Substitute -{ - /* The derivation that built this store path (empty if none). */ - Path deriver; - - /* Program to be executed to create the store path. Must be in - the output path of `storeExpr'. */ - Path program; - - /* Extra arguments to be passed to the program (the first argument - is the store path to be substituted). */ - Strings args; - - bool operator == (const Substitute & sub) const; -}; - -typedef list<Substitute> Substitutes; - - typedef std::map<Path, Path> Roots; @@ -57,13 +35,6 @@ public: /* Checks whether a path is valid. */ virtual bool isValidPath(const Path & path) = 0; - /* Return the substitutes for the given path. */ - virtual Substitutes querySubstitutes(const Path & path) = 0; - - /* More efficient variant if we just want to know if a path has - substitutes. */ - virtual bool hasSubstitutes(const Path & path); - /* Queries the hash of a valid path. */ virtual Hash queryPathHash(const Path & path) = 0; @@ -81,6 +52,13 @@ public: no deriver has been set. */ virtual Path queryDeriver(const Path & path) = 0; + /* Query the set of substitutable paths. */ + virtual PathSet querySubstitutablePaths() = 0; + + /* More efficient variant if we just want to know if a path has + substitutes. */ + virtual bool hasSubstitutes(const Path & path); + /* Copy the contents of a path to the store and register the validity the resulting path. The resulting path is returned. If `fixed' is true, then the output of a fixed-output @@ -109,10 +87,10 @@ public: /* Ensure that the output paths of the derivation are valid. If they are already valid, this is a no-op. Otherwise, validity - can be reached in two ways. First, if the output paths have - substitutes, then those can be used. Second, the output paths - can be created by running the builder, after recursively - building any sub-derivations. */ + can be reached in two ways. First, if the output paths is + substitutable, then build the path that way. Second, the + output paths can be created by running the builder, after + recursively building any sub-derivations. */ virtual void buildDerivations(const PathSet & drvPaths) = 0; /* Ensure that a path is valid. If it is not currently valid, it @@ -261,6 +239,17 @@ extern boost::shared_ptr<StoreAPI> store; boost::shared_ptr<StoreAPI> openStore(bool reserveSpace = true); +struct ValidPathInfo +{ + Path path; + Path deriver; + Hash hash; + PathSet references; +}; + +ValidPathInfo decodeValidPathInfo(std::istream & str); + + } |