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

in the middle of adding nixStoreState ...

This commit is contained in:
Wouter den Breejen 2007-05-18 19:50:58 +00:00
parent 4c63f18dcc
commit 8a7874d77d
11 changed files with 138 additions and 22 deletions

View file

@ -15,7 +15,7 @@
#include <fcntl.h>
#include "util.hh"
#include "../libstore/derivations.hh"
extern char * * environ;
@ -348,6 +348,61 @@ Path createTempDir(const Path & tmpRoot)
}
}
//TODO include rights, variable svn ... ?
Path createStateDirs(const DerivationStateOutputDirs & stateOutputDirs, const DerivationStateOutputs & stateOutputs)
{
/*while (1) {
checkInterrupt();
if (mkdir(statePath.c_str(), 0777) == 0) {
if (chown(statePath.c_str(), (uid_t) -1, getegid()) != 0)
throw SysError(format("setting group of state directory `%1%'") % statePath);
return tmpDir;
}
if (errno != EEXIST)
throw SysError(format("creating state directory `%1%'") % statePath);
}*/
string stateDir = stateOutputs.find("state")->second.statepath;
//Convert the map into a sortable vector
vector<DerivationStateOutputDir> stateDirsVector;
for (DerivationStateOutputDirs::const_reverse_iterator i = stateOutputDirs.rbegin(); i != stateOutputDirs.rend(); ++i){
stateDirsVector.push_back(i->second);
}
sort(stateDirsVector.begin(), stateDirsVector.end());
for (vector<DerivationStateOutputDir>::iterator i = stateDirsVector.begin(); i != stateDirsVector.end(); ++i)
{
DerivationStateOutputDir d = *(i);
printMsg(lvlError, format("test `%1%'") % d.path);
//calc create repos for this state location
Hash hash = hashString(htSHA256, stateDir + d.path);
/*
cd ...
svnadmin create hashcode
//create dirs
svn checkout file:///nix/state/XXXX/PATH_TO_REPOS dir
chmod ....
chmod ....
//create commit script
svn add *
svn revert file-that-I-do-not-want-added another-file-not-to-add
*/
}
//create super commit script
//return root path
Path tmpDir;
return tmpDir;
}
void createDirs(const Path & path)
{