mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 20:20:58 +01:00
Fixed revert issue
This commit is contained in:
parent
0fc5accd86
commit
856251df03
3 changed files with 17 additions and 16 deletions
|
|
@ -1397,7 +1397,7 @@ void DerivationGoal::startBuilder()
|
|||
|
||||
/* we check the recalculated state path at build time with the correct user for securiyt */
|
||||
checkStatePath(drv);
|
||||
|
||||
|
||||
if(drv.stateOutputs.find("state")->second.getCreateDirsBeforeInstall())
|
||||
createStateDirs(drv.stateOutputDirs, drv.stateOutputs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,15 +22,13 @@ namespace nix {
|
|||
void updatedStateDerivation(Path storePath)
|
||||
{
|
||||
//We dont remove the old .svn folders
|
||||
//nothing to do since New repostorys are created by createStateDirs
|
||||
//update in database?
|
||||
|
||||
printMsg(lvlTalkative, format("Resetting state drv settings like repositorys"));
|
||||
|
||||
printMsg(lvlTalkative, format("Resetting state drv settings"));
|
||||
}
|
||||
|
||||
void createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const DerivationStateOutputs & stateOutputs)
|
||||
{
|
||||
|
||||
Path statePath = stateOutputs.find("state")->second.statepath;
|
||||
string stateDir = statePath;
|
||||
|
||||
|
|
@ -51,7 +49,7 @@ void createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const De
|
|||
|
||||
string thisdir = d.path;
|
||||
|
||||
//Check if it is a file
|
||||
//If it is a file: continue
|
||||
if(thisdir.substr(thisdir.length() -1 , thisdir.length()) != "/")
|
||||
continue;
|
||||
|
||||
|
|
@ -127,12 +125,10 @@ Snapshots commitStatePathTxn(const Transaction & txn, const Path & statePath)
|
|||
throw Error(format("Type '%1%' is not handled in nix-state") % d.type);
|
||||
|
||||
//We got here so we need to commit
|
||||
|
||||
unsigned int revision_number;
|
||||
|
||||
if(pathExists(fullstatedir) || FileExist(fullstatedir)){
|
||||
revision_number = take_snapshot(fullstatedir);
|
||||
printMsg(lvlError, format("Snapshotted '%1%' with id '%2%'") % fullstatedir % revision_number);
|
||||
printMsg(lvlError, format("Snapshotted '%1%@%2%'") % fullstatedir % revision_number);
|
||||
}
|
||||
else
|
||||
revision_number = 0; //deleted, so we assign 0 to indicate that
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue