From 64519cfd657d024ae6e2bb74cb21ad21b886fd2a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 3 Dec 2008 15:06:30 +0000 Subject: * Unify the treatment of sources copied to the store, and recursive SHA-256 outputs of fixed-output derivations. I.e. they now produce the same store path: $ nix-store --add x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x $ nix-store --add-fixed --recursive sha256 x /nix/store/j2fq9qxvvxgqymvpszhs773ncci45xsj-x the latter being the same as the path that a derivation derivation { name = "x"; outputHashAlgo = "sha256"; outputHashMode = "recursive"; outputHash = "..."; ... }; produces. This does change the output path for such fixed-output derivations. Fortunately they are quite rare. The most common use is fetchsvn calls with SHA-256 hashes. (There are a handful of those is Nixpkgs, mostly unstable development packages.) * Documented the computation of store paths (in store-api.cc). --- src/libstore/local-store.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstore/local-store.hh') diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 37ed543fc3dc..3d47446f6e40 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -89,11 +89,11 @@ public: bool querySubstitutablePathInfo(const Path & substituter, const Path & path, SubstitutablePathInfo & info); - Path addToStore(const Path & srcPath, bool fixed = false, - bool recursive = false, string hashAlgo = "", + Path addToStore(const Path & srcPath, + bool recursive = true, string hashAlgo = "sha256", PathFilter & filter = defaultPathFilter); - Path addTextToStore(const string & suffix, const string & s, + Path addTextToStore(const string & name, const string & s, const PathSet & references); void exportPath(const Path & path, bool sign, -- cgit 1.4.1