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

Before modifying commit shell script

This commit is contained in:
Wouter den Breejen 2007-05-30 11:27:01 +00:00
parent cbd0d39583
commit 653e557e81
10 changed files with 140 additions and 91 deletions

View file

@ -97,8 +97,16 @@ Path makeStatePath(const string & type, const Hash & hash, const string & suffix
+ "-" + suffix + suffix_stateIdentifier;
}
Path makeStateReposPath(const string & type, const Hash & hash, const string & suffix, const string & stateIdentifier)
Path makeStateReposPath(const string & type, const Path statePath, const string subfolder, const string & suffix, const string & stateIdentifier)
{
//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);
//A little tick again, we dont want to add other repositorys in the root repository, so we rename it.
string subfolder_ = subfolder;
if(subfolder == "")
subfolder_ = stateRootRepos;
string suffix_stateIdentifier = stateIdentifier;
if(suffix_stateIdentifier != "")
suffix_stateIdentifier = "-" + suffix_stateIdentifier;
@ -112,7 +120,7 @@ Path makeStateReposPath(const string & type, const Hash & hash, const string & s
return nixStoreStateRepos + "/"
+ printHash32(compressHash(hashString(htSHA256, s), 20))
+ "-" + suffix + suffix_stateIdentifier;
+ "-" + suffix + suffix_stateIdentifier + "/" + subfolder_;
}
Path makeFixedOutputPath(bool recursive,