From ff762fb499be220ccd680f3bf68dca44a902a5ff Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 3 Dec 2008 16:10:17 +0000 Subject: * Pass HashType values instead of strings. --- src/libstore/local-store.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libstore/local-store.cc') diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index fc62a99930a2..bb53caacc5b7 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -656,7 +656,7 @@ void LocalStore::invalidatePath(const Path & path) Path LocalStore::addToStore(const Path & _srcPath, - bool recursive, string hashAlgo, PathFilter & filter) + bool recursive, HashType hashAlgo, PathFilter & filter) { Path srcPath(absPath(_srcPath)); debug(format("adding `%1%' to the store") % srcPath); @@ -670,7 +670,7 @@ Path LocalStore::addToStore(const Path & _srcPath, else sink.s = readFile(srcPath); - Hash h = hashString(parseHashType(hashAlgo), sink.s); + Hash h = hashString(hashAlgo, sink.s); Path dstPath = makeFixedOutputPath(recursive, hashAlgo, h, baseNameOf(srcPath)); @@ -700,7 +700,7 @@ Path LocalStore::addToStore(const Path & _srcPath, above (if called with recursive == true and hashAlgo == sha256); otherwise, compute it here. */ registerValidPath(dstPath, - (recursive && hashAlgo == "sha256") ? h : + (recursive && hashAlgo == htSHA256) ? h : (recursive ? hashString(htSHA256, sink.s) : hashPath(htSHA256, dstPath)), PathSet(), ""); } -- cgit 1.4.1