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

Fixed sharing issue. Created unshare method.

This commit is contained in:
Wouter den Breejen 2007-09-18 15:10:48 +00:00
parent 315cd18337
commit 51cff21c92
18 changed files with 593 additions and 456 deletions

View file

@ -609,25 +609,20 @@ static void installDerivations(Globals & globals,
return;
}
printMsg(lvlError, format("DONE!!!!!!!!"));
createUserEnv(globals.state, allElems,
profile, globals.keepDerivations);
printMsg(lvlError, format("DONE!!!!!!!!"));
//After all components have been built succesfully, share their state paths with the old ones
for (StringPairs::iterator i = toBeShared.begin(); i != toBeShared.end(); ++i){
printMsg(lvlError, format("Sharing state from old <-- new component '%1%' <-- '%2%'") % i->first % i->second);
deletePath(i->second); //Remove contents of current new state path
symlinkPath(i->first, i->second); //Share new statepath to the old statepath
//Set in database
store->setSharedState(i->first, i->second);
//Share from new --> to existing
store->shareState(i->second, i->first, false);
}
//**********************
//Let the stateDirs in /nix/state point to the solidStateDependencies
for (StringPairs::iterator i = externalStates.begin(); i != externalStates.end(); ++i){
@ -668,6 +663,8 @@ static void installDerivations(Globals & globals,
symlinkPath(statePath, externalState);
}
//**********************
}