mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
State is now maintained (their paths are automatically shared), unless sharedState is set in the nix-expr, when a new version with the same drv-name of the component is installed
This commit is contained in:
parent
7424d72098
commit
4089bd5f19
9 changed files with 110 additions and 75 deletions
|
|
@ -20,6 +20,8 @@ my $srcDirSlashes = 3;
|
||||||
sub createLinks {
|
sub createLinks {
|
||||||
my $srcDir = shift;
|
my $srcDir = shift;
|
||||||
|
|
||||||
|
#Lookup each $stateIdentifiers in $path_identifier
|
||||||
|
#we strip $srcDir to its rootdir e.g. /nix/store/......./
|
||||||
my @srcDirParts = split /\// , $srcDir;
|
my @srcDirParts = split /\// , $srcDir;
|
||||||
my $srcDirRoot = "";
|
my $srcDirRoot = "";
|
||||||
my $srcDirCounter=1;
|
my $srcDirCounter=1;
|
||||||
|
|
@ -28,8 +30,8 @@ sub createLinks {
|
||||||
$srcDirCounter++;
|
$srcDirCounter++;
|
||||||
}
|
}
|
||||||
#print "srcDirRoot $srcDirRoot \n";
|
#print "srcDirRoot $srcDirRoot \n";
|
||||||
|
|
||||||
my $pkgStateIdentifier = $path_identifier{$srcDirRoot};
|
my $pkgStateIdentifier = $path_identifier{$srcDirRoot};
|
||||||
|
|
||||||
my $dstDir = shift;
|
my $dstDir = shift;
|
||||||
my $ignoreCollisions = shift;
|
my $ignoreCollisions = shift;
|
||||||
|
|
||||||
|
|
@ -138,7 +140,6 @@ my %postponed;
|
||||||
sub addPkg;
|
sub addPkg;
|
||||||
sub addPkg {
|
sub addPkg {
|
||||||
my $pkgDir = shift;
|
my $pkgDir = shift;
|
||||||
my $pkgStateIdentifier = shift;
|
|
||||||
my $ignoreCollisions = shift;
|
my $ignoreCollisions = shift;
|
||||||
|
|
||||||
return if (defined $done{$pkgDir});
|
return if (defined $done{$pkgDir});
|
||||||
|
|
@ -167,11 +168,12 @@ my $si_counter = 0;
|
||||||
|
|
||||||
foreach my $pkgDir (@storePaths) { #Commented the sort out
|
foreach my $pkgDir (@storePaths) { #Commented the sort out
|
||||||
|
|
||||||
print "SP: $pkgDir \n";
|
#Link each $pkgDir to a $stateIdentifiers in $path_identifier
|
||||||
|
#print "SP: $pkgDir \n";
|
||||||
$path_identifier{$pkgDir} = $stateIdentifiers[$si_counter];
|
$path_identifier{$pkgDir} = $stateIdentifiers[$si_counter];
|
||||||
print "SI: $path_identifier{$pkgDir} \n";
|
#print "SI: $path_identifier{$pkgDir} \n";
|
||||||
|
|
||||||
addPkg($pkgDir, $stateIdentifiers[$si_counter], 0);
|
addPkg($pkgDir, 0);
|
||||||
$si_counter++;
|
$si_counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -182,7 +184,7 @@ foreach my $pkgDir (@storePaths) { #Commented the sort out
|
||||||
# priority in case of collisions.
|
# priority in case of collisions.
|
||||||
while (scalar(keys %postponed) > 0) {
|
while (scalar(keys %postponed) > 0) {
|
||||||
|
|
||||||
my @pkgDirs = keys %postponed; # TODODODODODOD !!!!!!!!!!!!!!!!!!!!!
|
my @pkgDirs = keys %postponed;
|
||||||
%postponed = ();
|
%postponed = ();
|
||||||
foreach my $pkgDir (sort @pkgDirs) {
|
foreach my $pkgDir (sort @pkgDirs) {
|
||||||
addPkg($pkgDir, 1);
|
addPkg($pkgDir, 1);
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,8 @@ static bool getDerivation(EvalState & state, Expr e,
|
||||||
|
|
||||||
drv.attrs = attrs;
|
drv.attrs = attrs;
|
||||||
|
|
||||||
|
//printMsg(lvlError, format("TEST '%1%'") % evalStringNoCtx(state, a) );
|
||||||
|
|
||||||
drv.attrPath = attrPath;
|
drv.attrPath = attrPath;
|
||||||
|
|
||||||
drvs.push_back(drv);
|
drvs.push_back(drv);
|
||||||
|
|
|
||||||
|
|
@ -1821,16 +1821,10 @@ void DerivationGoal::computeClosure()
|
||||||
if(sharedState != ""){
|
if(sharedState != ""){
|
||||||
//Remove state path
|
//Remove state path
|
||||||
deletePathWrapped(statePath);
|
deletePathWrapped(statePath);
|
||||||
|
sharePath(sharedState, statePath);
|
||||||
//Symlink link to the share path
|
|
||||||
Strings p_args;
|
|
||||||
p_args.push_back("-sf");
|
|
||||||
p_args.push_back(sharedState);
|
|
||||||
p_args.push_back(statePath);
|
|
||||||
runProgram_AndPrintOutput("ln", true, p_args, "ln"); //run
|
|
||||||
|
|
||||||
//Set in database
|
//Set in database
|
||||||
setSharedStateTxn(txn, statePath, sharedState);
|
setSharedStateTxn(txn, sharedState, statePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2587,9 +2581,7 @@ void LocalStore::buildDerivations(const PathSet & drvPaths)
|
||||||
Worker worker;
|
Worker worker;
|
||||||
Goals goals;
|
Goals goals;
|
||||||
for (PathSet::const_iterator i = drvPaths.begin(); i != drvPaths.end(); ++i){
|
for (PathSet::const_iterator i = drvPaths.begin(); i != drvPaths.end(); ++i){
|
||||||
|
//printMsg(lvlError, format("BUILD: '%1%'") % *i);
|
||||||
printMsg(lvlError, format("BUILD: '%1%'") % *i);
|
|
||||||
|
|
||||||
goals.insert(worker.makeDerivationGoal(*i));
|
goals.insert(worker.makeDerivationGoal(*i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1729,13 +1729,13 @@ bool querySolidStateReferencesTxn(const Transaction & txn, const Path & statePat
|
||||||
return notempty;
|
return notempty;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setSharedStateTxn(const Transaction & txn, const Path & statePath, const Path & shared_with)
|
void setSharedStateTxn(const Transaction & txn, const Path & fromExisting, const Path & toNew)
|
||||||
{
|
{
|
||||||
//Remove earlier entries
|
//Remove earlier entries
|
||||||
nixDB.delPair(txn, dbSharedState, statePath);
|
nixDB.delPair(txn, dbSharedState, toNew);
|
||||||
|
|
||||||
//Set new entry
|
//Set new entry
|
||||||
nixDB.setString(txn, dbSharedState, statePath, shared_with);
|
nixDB.setString(txn, dbSharedState, toNew, fromExisting);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool querySharedStateTxn(const Transaction & txn, const Path & statePath, Path & shared_with)
|
bool querySharedStateTxn(const Transaction & txn, const Path & statePath, Path & shared_with)
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@ bool isValidStatePathTxn(const Transaction & txn, const Path & path);
|
||||||
void setSolidStateReferencesTxn(const Transaction & txn, const Path & statePath, const PathSet & paths);
|
void setSolidStateReferencesTxn(const Transaction & txn, const Path & statePath, const PathSet & paths);
|
||||||
bool querySolidStateReferencesTxn(const Transaction & txn, const Path & statePath, PathSet & paths);
|
bool querySolidStateReferencesTxn(const Transaction & txn, const Path & statePath, PathSet & paths);
|
||||||
|
|
||||||
void setSharedStateTxn(const Transaction & txn, const Path & statePath, const Path & shared_with);
|
void setSharedStateTxn(const Transaction & txn, const Path & fromExisting, const Path & toNew);
|
||||||
PathSet toNonSharedPathSetTxn(const Transaction & txn, const PathSet & statePaths);
|
PathSet toNonSharedPathSetTxn(const Transaction & txn, const PathSet & statePaths);
|
||||||
Path toNonSharedPathTxn(const Transaction & txn, const Path & statePath);
|
Path toNonSharedPathTxn(const Transaction & txn, const Path & statePath);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1264,4 +1264,14 @@ string padd(const string & s, char c , unsigned int size, bool front)
|
||||||
return ss;
|
return ss;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sharePath(const Path & fromExisting, const Path & toNew)
|
||||||
|
{
|
||||||
|
//Symlink link to the share path
|
||||||
|
Strings p_args;
|
||||||
|
p_args.push_back("-sf");
|
||||||
|
p_args.push_back(fromExisting);
|
||||||
|
p_args.push_back(toNew);
|
||||||
|
runProgram_AndPrintOutput("ln", true, p_args, "ln"); //run
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -322,6 +322,8 @@ void ensureDirExists(const Path & path);
|
||||||
|
|
||||||
string padd(const string & s, char c , unsigned int size, bool front = false);
|
string padd(const string & s, char c , unsigned int size, bool front = false);
|
||||||
|
|
||||||
|
void sharePath(const Path & fromExisting, const Path & toNew);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !__UTIL_H */
|
#endif /* !__UTIL_H */
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "db.hh"
|
#include "db.hh"
|
||||||
#include "util.hh"
|
#include "util.hh"
|
||||||
|
#include "local-store.hh"
|
||||||
|
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
@ -190,14 +191,9 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||||
|
|
||||||
manifest = ATinsert(manifest, makeAttrs(as)); //All DrvInfo's are inserted here
|
manifest = ATinsert(manifest, makeAttrs(as)); //All DrvInfo's are inserted here
|
||||||
|
|
||||||
/*ATermList ass = ATmakeList1(
|
//Insert the new stateIdentifier into the stateIdentifiers Atermlist
|
||||||
makeBind(toATerm("stateIdentifier"), makeStr(i->queryStateIdentifier(state)), makeNoPos())
|
|
||||||
);*/
|
|
||||||
|
|
||||||
stateIdentifiers = ATinsert(stateIdentifiers, makeStr(i->queryStateIdentifier(state)));
|
stateIdentifiers = ATinsert(stateIdentifiers, makeStr(i->queryStateIdentifier(state)));
|
||||||
|
|
||||||
//printMsg(lvlError, format("TEST2 '%1%'") % makeAttrs(as));
|
|
||||||
|
|
||||||
inputs = ATinsert(inputs, makeStr(i->queryOutPath(state)));
|
inputs = ATinsert(inputs, makeStr(i->queryOutPath(state)));
|
||||||
|
|
||||||
/* This is only necessary when installing store paths, e.g.,
|
/* This is only necessary when installing store paths, e.g.,
|
||||||
|
|
@ -210,13 +206,7 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||||
references.insert(drvPath);
|
references.insert(drvPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
//printMsg(lvlError, format("TEST '%1%'") % atPrint(canonicaliseExpr(makeList(ATreverse(manifest)))) );
|
//printMsg(lvlError, format("TEST '%1%'") % atPrint(canonicaliseExpr(makeList(ATreverse(stateIdentifiers)))) );
|
||||||
//printMsg(lvlError, format("TEST2 '%1%'") % makeList(ATreverse(manifest)) );
|
|
||||||
//printMsg(lvlError, format("TEST2 '%1%'") % makeBind(toATerm("stateIdentifiers"), makeList(ATreverse(manifest)), makeNoPos()) );
|
|
||||||
printMsg(lvlError, format("TEST '%1%'") % atPrint(canonicaliseExpr(makeList(ATreverse(stateIdentifiers)))) );
|
|
||||||
|
|
||||||
/* Extract ... */
|
|
||||||
|
|
||||||
|
|
||||||
/* Also write a copy of the list of inputs to the store; we need
|
/* Also write a copy of the list of inputs to the store; we need
|
||||||
it for future modifications of the environment. */
|
it for future modifications of the environment. */
|
||||||
|
|
@ -233,24 +223,15 @@ static void createUserEnv(EvalState & state, const DrvInfos & elems,
|
||||||
makeStr(manifestFile, singleton<PathSet>(manifestFile)), makeNoPos())
|
makeStr(manifestFile, singleton<PathSet>(manifestFile)), makeNoPos())
|
||||||
)));
|
)));
|
||||||
|
|
||||||
//printMsg(lvlError, format("Write manifest '%1%'") % topLevel);
|
|
||||||
|
|
||||||
/* Instantiate it. */
|
/* Instantiate it. */
|
||||||
debug(format("evaluating builder expression `%1%'") % topLevel);
|
debug(format("evaluating builder expression `%1%'") % topLevel);
|
||||||
DrvInfo topLevelDrv;
|
DrvInfo topLevelDrv;
|
||||||
if (!getDerivation(state, topLevel, topLevelDrv))
|
if (!getDerivation(state, topLevel, topLevelDrv))
|
||||||
abort();
|
abort();
|
||||||
|
|
||||||
printMsg(lvlError, format("TEST5 '%1%'") % topLevelDrv.queryStateIdentifier(state));
|
|
||||||
printMsg(lvlError, format("BUILD ENV DRV: '%1%'") % topLevelDrv.queryDrvPath(state) );
|
|
||||||
|
|
||||||
/* Realise the resulting store expression. */
|
/* Realise the resulting store expression. */
|
||||||
debug(format("building user environment"));
|
debug(format("building user environment"));
|
||||||
store->buildDerivations(singleton<PathSet>(topLevelDrv.queryDrvPath(state))); //HERE IS THE DRV !!!!!!!!!!!
|
store->buildDerivations(singleton<PathSet>(topLevelDrv.queryDrvPath(state)));
|
||||||
|
|
||||||
//switch .....
|
|
||||||
|
|
||||||
printMsg(lvlError, format("TEST6"));
|
|
||||||
|
|
||||||
/* Switch the current user environment to the output path. */
|
/* Switch the current user environment to the output path. */
|
||||||
debug(format("switching to new user environment"));
|
debug(format("switching to new user environment"));
|
||||||
|
|
@ -342,10 +323,6 @@ static void queryInstSources(EvalState & state,
|
||||||
{
|
{
|
||||||
InstallSourceType type = instSource.type;
|
InstallSourceType type = instSource.type;
|
||||||
|
|
||||||
for (Strings::const_iterator i = args.begin(); i != args.end(); ++i)
|
|
||||||
printMsg(lvlError, format("queryInstSources arg '%1%'") % *i);
|
|
||||||
printMsg(lvlError, format("queryInstSources TYPE '%1%'") % (type == srcUnknown));
|
|
||||||
|
|
||||||
if (type == srcUnknown && args.size() > 0 && args.front()[0] == '/')
|
if (type == srcUnknown && args.size() > 0 && args.front()[0] == '/')
|
||||||
type = srcStorePaths;
|
type = srcStorePaths;
|
||||||
|
|
||||||
|
|
@ -399,12 +376,8 @@ static void queryInstSources(EvalState & state,
|
||||||
for (Strings::const_iterator i = args.begin();
|
for (Strings::const_iterator i = args.begin();
|
||||||
i != args.end(); ++i)
|
i != args.end(); ++i)
|
||||||
{
|
{
|
||||||
printMsg(lvlError, format("AAAAA333 %1%'") % *i);
|
|
||||||
|
|
||||||
assertStorePath(*i);
|
assertStorePath(*i);
|
||||||
|
|
||||||
printMsg(lvlError, format("AAAAA444 %1%'") % *i);
|
|
||||||
|
|
||||||
DrvInfo elem;
|
DrvInfo elem;
|
||||||
elem.attrs = boost::shared_ptr<ATermMap>(new ATermMap(0)); /* ugh... */
|
elem.attrs = boost::shared_ptr<ATermMap>(new ATermMap(0)); /* ugh... */
|
||||||
string name = baseNameOf(*i);
|
string name = baseNameOf(*i);
|
||||||
|
|
@ -421,13 +394,8 @@ static void queryInstSources(EvalState & state,
|
||||||
name = string(name, 0, name.size() - drvExtension.size());
|
name = string(name, 0, name.size() - drvExtension.size());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
elem.setOutPath(*i);
|
elem.setOutPath(*i);
|
||||||
|
|
||||||
//if(drv.stateOutputs.size() != 0)
|
|
||||||
// elem.setStateIdentifier(drv.stateOutputs.find("state")->second.stateIdentifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
elem.name = name;
|
elem.name = name;
|
||||||
|
|
||||||
elems.push_back(elem);
|
elems.push_back(elem);
|
||||||
|
|
@ -510,14 +478,14 @@ static void installDerivations(Globals & globals,
|
||||||
path is not the one we want (e.g., `java-front' versus
|
path is not the one we want (e.g., `java-front' versus
|
||||||
`java-front-0.9pre15899'). */
|
`java-front-0.9pre15899'). */
|
||||||
|
|
||||||
//printMsg(lvlError, format("New component to install DRV: '%1%'") % i->queryDrvPath(globals.state));
|
//Set the state indentifier if it is a state-component
|
||||||
|
printMsg(lvlError, format("New component to install DRV: '%1%'") % i->queryDrvPath(globals.state));
|
||||||
//Set the state indentifier
|
Derivation drv = derivationFromPath(i->queryDrvPath(globals.state));
|
||||||
if( store->isStateComponent(i->queryOutPath(globals.state)) )
|
if(store->isStateDrv(drv))
|
||||||
{
|
{
|
||||||
Derivation drv = derivationFromPath(i->queryDrvPath(globals.state));
|
|
||||||
DerivationStateOutputs stateOutputs = drv.stateOutputs;
|
DerivationStateOutputs stateOutputs = drv.stateOutputs;
|
||||||
string stateIdentifier = stateOutputs.find("state")->second.stateIdentifier;
|
string stateIdentifier = stateOutputs.find("state")->second.stateIdentifier;
|
||||||
|
printMsg(lvlError, format("Add '%2%' with '%1%'") % stateIdentifier % i->queryOutPath(globals.state) );
|
||||||
if(stateIdentifier == "")
|
if(stateIdentifier == "")
|
||||||
i->setStateIdentifier("__EMTPY__");
|
i->setStateIdentifier("__EMTPY__");
|
||||||
else
|
else
|
||||||
|
|
@ -535,19 +503,67 @@ static void installDerivations(Globals & globals,
|
||||||
lockProfile(lock, profile);
|
lockProfile(lock, profile);
|
||||||
DrvInfos installedElems = queryInstalled(globals.state, profile);
|
DrvInfos installedElems = queryInstalled(globals.state, profile);
|
||||||
|
|
||||||
|
|
||||||
|
StringPairs toBeShared; //Mapping from old --> new statePath
|
||||||
|
|
||||||
DrvInfos allElems(newElems);
|
DrvInfos allElems(newElems);
|
||||||
for (DrvInfos::iterator i = installedElems.begin(); i != installedElems.end(); ++i)
|
for (DrvInfos::iterator i = installedElems.begin(); i != installedElems.end(); ++i)
|
||||||
{
|
{
|
||||||
DrvName drvName(i->name);
|
DrvName drvName(i->name);
|
||||||
|
|
||||||
//TODO !!!!!!!!!!!!!!!!!!!!!!!! SHARE (OR COPY) STATE HERE IF NEEDED
|
if (!globals.preserveInstalled && newNames.find(drvName.name) != newNames.end()){
|
||||||
//if( newNames.find(drvName.name) != newNames.end() && identifier == identifier )
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
//******** We're gonna check if the component and state indentifiers are the same,
|
||||||
|
// since we may need to share state in that case.
|
||||||
|
|
||||||
if (!globals.preserveInstalled && newNames.find(drvName.name) != newNames.end())
|
string oldStateIdentifier = i->queryStateIdentifier(globals.state); //get the old stateIdentifier
|
||||||
printMsg(lvlInfo, format("replacing old `%1%'") % i->name);
|
if(oldStateIdentifier != "__NOSTATE__")
|
||||||
|
{
|
||||||
|
//get the new stateIdentifier
|
||||||
|
string newStateIdentifier;
|
||||||
|
string newStatePath;
|
||||||
|
string newSharedState;
|
||||||
|
for (DrvInfos::iterator j = newElems.begin(); j != newElems.end(); ++j) {
|
||||||
|
DrvName newDrvName(j->name);
|
||||||
|
if(newDrvName.name == drvName.name){
|
||||||
|
Derivation newDrv = derivationFromPath(j->queryDrvPath(globals.state));
|
||||||
|
DerivationStateOutputs newStateOutputs = newDrv.stateOutputs;
|
||||||
|
newStateIdentifier = newStateOutputs.find("state")->second.stateIdentifier;
|
||||||
|
newStatePath = newDrv.stateOutputs.find("state")->second.statepath;
|
||||||
|
newSharedState = newDrv.stateOutputs.find("state")->second.sharedState;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//printMsg(lvlError, format("old '%1%' new '%2%'") % oldStateIdentifier % newStateIdentifier);
|
||||||
|
|
||||||
|
if( newSharedState == ""
|
||||||
|
&&
|
||||||
|
(oldStateIdentifier == newStateIdentifier
|
||||||
|
|| (oldStateIdentifier == "__EMTPY__" && newStateIdentifier == ""))
|
||||||
|
){
|
||||||
|
|
||||||
|
string oldStatePath;
|
||||||
|
//query old state path
|
||||||
|
PathSet derivers = queryDerivers(noTxn, i->queryOutPath(globals.state), newStateIdentifier, getCallingUserName());
|
||||||
|
if(derivers.size() != 1)
|
||||||
|
throw Error(format("Internal Error: There is not exactly one deriver with state_identifier '%1%' for path '%2%'")
|
||||||
|
% newStateIdentifier % i->queryOutPath(globals.state));
|
||||||
|
Path oldDrvPath = *(derivers.begin());
|
||||||
|
Derivation oldDrv = derivationFromPath(oldDrvPath);
|
||||||
|
oldStatePath = oldDrv.stateOutputs.find("state")->second.statepath;
|
||||||
|
|
||||||
|
//SharePaths
|
||||||
|
printMsg(lvlError, format("Sharing state from old to new component '%1%' --> '%2%'") % newStatePath % oldStatePath);
|
||||||
|
toBeShared[oldStatePath] = newStatePath;
|
||||||
|
}
|
||||||
|
else{ //If not equal, then we do not replace, so we push back (just like the else branch)
|
||||||
|
printMsg(lvlError, format("Installing new state-component component '%1%' with identifier '%2%'") % drvName.name % oldStateIdentifier);
|
||||||
|
allElems.push_back(*i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
printMsg(lvlInfo, format("replacing old `%1%'") % i->name);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
allElems.push_back(*i);
|
allElems.push_back(*i);
|
||||||
}
|
}
|
||||||
|
|
@ -562,6 +578,18 @@ static void installDerivations(Globals & globals,
|
||||||
|
|
||||||
createUserEnv(globals.state, allElems,
|
createUserEnv(globals.state, allElems,
|
||||||
profile, globals.keepDerivations);
|
profile, globals.keepDerivations);
|
||||||
|
|
||||||
|
//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){
|
||||||
|
|
||||||
|
deletePathWrapped(i->second); //Remove contents of current new state path
|
||||||
|
sharePath(i->first, i->second); //Share new statepath to the old statepath
|
||||||
|
|
||||||
|
//Set in database
|
||||||
|
setSharedStateTxn(noTxn, i->first, i->second);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -578,6 +606,7 @@ static void opInstall(Globals & globals,
|
||||||
typedef enum { utLt, utLeq, utEq, utAlways } UpgradeType;
|
typedef enum { utLt, utLeq, utEq, utAlways } UpgradeType;
|
||||||
|
|
||||||
|
|
||||||
|
//TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
static void upgradeDerivations(Globals & globals,
|
static void upgradeDerivations(Globals & globals,
|
||||||
const Strings & args, UpgradeType upgradeType)
|
const Strings & args, UpgradeType upgradeType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,6 @@ Path createGeneration(Path profile, Path outPath)
|
||||||
makeName(profile, num + 1, generation);
|
makeName(profile, num + 1, generation);
|
||||||
addPermRoot(outPath, generation, false, true);
|
addPermRoot(outPath, generation, false, true);
|
||||||
|
|
||||||
printMsg(lvlError, format("TEST3 '%1%' '%2%' --> '%3%'") % profile % outPath % generation);
|
|
||||||
|
|
||||||
return generation;
|
return generation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue