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

Fixed backwards compatible hack & added state creation call after build

This commit is contained in:
Wouter den Breejen 2007-05-22 13:19:27 +00:00
parent 73995157e3
commit 86b053dd80
5 changed files with 67 additions and 16 deletions

View file

@ -1377,14 +1377,11 @@ void DerivationGoal::startBuilder()
tmpDir = createTempDir();
/* Create the state directory where the component can store it's state files place */
//TODO
//TODO include addDirsBefore ...
//if(enableState){ ...
//stateDir = createStateDirs(drv.stateOutputDirs, drv.stateOutputs);
//}
//TODO create the startupscript
//printMsg(lvlError, format("STATE: `%1%'") % );
//We only create state dirs when state is enabled and when the dirs need to be created before the installation
if(drv.stateOutputs.size() != 0)
if(drv.stateOutputs.find("state")->second.getCreateDirsBeforeInstall())
createStateDirs(drv.stateOutputDirs, drv.stateOutputs);
/* For convenience, set an environment pointing to the top build
directory. */
@ -1616,6 +1613,11 @@ void DerivationGoal::computeClosure()
map<Path, PathSet> allReferences;
map<Path, Hash> contentHashes;
//We create state dirs only when state is enabled and when the dirs need to be created after the installation
if(drv.stateOutputs.size() != 0)
if(!drv.stateOutputs.find("state")->second.getCreateDirsBeforeInstall())
createStateDirs(drv.stateOutputDirs, drv.stateOutputs);
/* Check whether the output paths were created, and grep each
output path to determine what other paths it references. Also make all
output paths read-only. */