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/store-api.hh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/libstore/store-api.hh') diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index cbf2f7ef29..6fbe979316 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -63,14 +63,11 @@ public: PathSet & referrers) = 0; /* Copy the contents of a path to the store and register the - validity the resulting path. The resulting path is - returned. */ - virtual Path addToStore(const Path & srcPath) = 0; - - /* Like addToStore(), but for pre-adding the outputs of - fixed-output derivations. */ - virtual Path addToStoreFixed(bool recursive, string hashAlgo, - const Path & srcPath) = 0; + validity the resulting path. The resulting path is returned. + If `fixed' is true, then the output of a fixed-output + derivation is pre-loaded into the Nix store. */ + virtual Path addToStore(const Path & srcPath, bool fixed = false, + bool recursive = false, string hashAlgo = "") = 0; /* Like addToStore, but the contents written to the output path is a regular file containing the given string. */ @@ -119,8 +116,8 @@ Path makeFixedOutputPath(bool recursive, it computes the store path to which srcPath is to be copied. Returns the store path and the cryptographic hash of the contents of srcPath. */ -std::pair computeStorePathForPath(bool fixed, bool recursive, - string hashAlgo, const Path & srcPath); +std::pair computeStorePathForPath(const Path & srcPath, + bool fixed = false, bool recursive = false, string hashAlgo = ""); /* Preparatory part of addTextToStore(). -- cgit 1.4.1