1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00

* Pass HashType values instead of strings.

This commit is contained in:
Eelco Dolstra 2008-12-03 16:10:17 +00:00
parent 1307b22223
commit ff762fb499
11 changed files with 36 additions and 23 deletions

View file

@ -279,16 +279,16 @@ Path RemoteStore::queryDeriver(const Path & path)
Path RemoteStore::addToStore(const Path & _srcPath,
bool recursive, string hashAlgo, PathFilter & filter)
bool recursive, HashType hashAlgo, PathFilter & filter)
{
Path srcPath(absPath(_srcPath));
writeInt(wopAddToStore, to);
writeString(baseNameOf(srcPath), to);
/* backwards compatibility hack */
writeInt((hashAlgo == "sha256" && recursive) ? 0 : 1, to);
writeInt((hashAlgo == htSHA256 && recursive) ? 0 : 1, to);
writeInt(recursive ? 1 : 0, to);
writeString(hashAlgo, to);
writeString(printHashType(hashAlgo), to);
dumpPath(srcPath, to, filter);
processStderr();
return readStorePath(from);