1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-27 04:30:59 +01:00

in the middle of adding nixStoreState ...

This commit is contained in:
Wouter den Breejen 2007-05-18 19:50:58 +00:00
parent 4c63f18dcc
commit 8a7874d77d
11 changed files with 138 additions and 22 deletions

View file

@ -66,8 +66,7 @@ void checkStoreName(const string & name)
}
Path makeStorePath(const string & type,
const Hash & hash, const string & suffix)
Path makeStorePath(const string & type, const Hash & hash, const string & suffix)
{
/* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */
string s = type + ":sha256:" + printHash(hash) + ":"
@ -80,6 +79,20 @@ Path makeStorePath(const string & type,
+ "-" + suffix;
}
Path makeStatePath(const string & type, const Hash & hash, const string & suffix)
{
/* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */
string s = type + ":sha256:" + printHash(hash) + ":"
+ nixStoreState + ":" + suffix;
checkStoreName(suffix);
return nixStoreState + "/"
+ printHash32(compressHash(hashString(htSHA256, s), 20))
+ "-" + suffix;
}
Path makeFixedOutputPath(bool recursive,
string hashAlgo, Hash hash, string name)