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

Changed the [solid-state-dependencies] list in the derivation to a single variable 'externalState' (since we also have a single state path) which can, for instance, be set to ~/.mozilla-test in the case of firefox (not bugfree yet)

This commit is contained in:
Wouter den Breejen 2007-09-03 19:22:09 +00:00
parent 68cb244c90
commit 89ab441fd2
10 changed files with 118 additions and 56 deletions

View file

@ -423,6 +423,7 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
bool createDirsBeforeInstall = false;
string runtimeStateArgs = "";
string sharedState = "";
string externalState = "";
vector<DerivationStateOutputDir> stateDirs;
for (ATermMap::const_iterator i = attrs.begin(); i != attrs.end(); ++i) {
@ -508,7 +509,9 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
}
}
else if(key == "solidStateDependencies"){
else if(key == "solidStateDependency"){
/*
ATermList es;
value = evalExpr(state, value);
if (!matchList(value, es)) {
@ -520,6 +523,8 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
string s = coerceToString(state, *i, context, true);
drv.solidStateDeps.insert(s);
}
*/
externalState = coerceToString(state, value, context, true);
}
else if(key == "shareType") { shareType = coerceToString(state, value, context, true); }
else if(key == "synchronization") { syncState = coerceToString(state, value, context, true); }
@ -621,7 +626,7 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
if(enableState && !disableState){
if(runtimeStateArgs == ""){
string enableStateS = bool2string("true");
drv.stateOutputs["state"] = DerivationStateOutput("", "", "", "", stateIdentifier, enableStateS, "", "", "", runtimeStateArgs, queryCurrentUsername(), "", false);
drv.stateOutputs["state"] = DerivationStateOutput("", "", "", "", stateIdentifier, enableStateS, "", "", "", runtimeStateArgs, queryCurrentUsername(), "", "", false);
}
}
@ -634,13 +639,6 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
drv.env["out"] = outPath;
drv.outputs["out"] = DerivationOutput(outPath, outputHashAlgo, outputHash);
/* Replace $(statePath) in solidStateDeps */
for (StringSet::iterator i = drv.solidStateDeps.begin(); i != drv.solidStateDeps.end(); ++i)
if(*i == "$(statePath)" || "$statePath" ){
drv.solidStateDeps.erase(*i);
drv.solidStateDeps.insert(outPath);
}
//printMsg(lvlError, format("DerivationOutput %1% %2% %3%") % outPath % outputHashAlgo % outputHash);
//only add state when we have to to keep compitibilty with the 'old' format.
//We add state when it's enbaled by the keywords, and not excplicitly disabled by the user
@ -657,7 +655,7 @@ static Expr prim_derivationStrict(EvalState & state, const ATermVector & args)
string enableStateS = bool2string("true");
string createDirsBeforeInstallS = bool2string(createDirsBeforeInstall);
drv.stateOutputs["state"] = DerivationStateOutput(stateOutPath, printHash(componentHash), outputHashAlgo, outputHash, stateIdentifier, enableStateS,
shareType, syncState, createDirsBeforeInstallS, runtimeStateArgs, queryCurrentUsername(), sharedState);
shareType, syncState, createDirsBeforeInstallS, runtimeStateArgs, queryCurrentUsername(), sharedState, externalState);
for(vector<DerivationStateOutputDir>::iterator i = stateDirs.begin(); i != stateDirs.end(); ++i)
drv.stateOutputDirs[(*i).path] = *(i);