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

Replaced SVN by Ext3COW as a backend for state (still some things need to happen: reverting doesn't go right in all cases yet)

This commit is contained in:
Wouter den Breejen 2007-07-25 21:52:33 +00:00
parent dc4395b737
commit 0fc5accd86
16 changed files with 269 additions and 268 deletions

View file

@ -151,29 +151,6 @@ void checkStatePath(const Derivation & drv)
Error(format("The statepath from the Derivation does not match the recalculated statepath, are u trying to spoof the statepath?"));
}
Path getStateReposPath(const string & type, const Path statePath)
{
//This is a little trick: we could use the same hash as the statepath, but we change it so the repository also gets a unique scannable hash
Hash hash = hashString(htSHA256, statePath);
//Extract suffix and stateIdentifier from statePath
int pos = statePath.find_first_of("-");
string suffix = statePath.substr(pos, statePath.length());
/* e.g., "source:sha256:1abc...:/nix/store:foo.tar.gz" */
string s = type + ":sha256:" + printHash(hash) + ":"
+ nixStoreState + ":" + suffix;
checkStoreName(suffix);
Path path = nixStoreStateRepos + "/"
+ printHash32(compressHash(hashString(htSHA256, s), 20))
+ suffix + "/";
return path;
}
Path makeFixedOutputPath(bool recursive,
string hashAlgo, Hash hash, string name)
{