mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 12:10:59 +01:00
Before moving scanForStateReferences(...)
This commit is contained in:
parent
b1cc9e9a45
commit
5164a77aab
1 changed files with 45 additions and 25 deletions
|
|
@ -1688,31 +1688,7 @@ void DerivationGoal::computeClosure()
|
|||
/* For this output path, find the references to other paths contained in it. */
|
||||
PathSet references = scanForReferences(path, allPaths);
|
||||
|
||||
/* For this state-output path, find the references to other paths contained in it.
|
||||
* Get the state paths (instead of out paths) from all components, and then call
|
||||
* scanForStateReferences().
|
||||
*/
|
||||
PathSet allStatePaths;
|
||||
for (PathSet::const_iterator i = allPaths.begin(); i != allPaths.end(); i++){
|
||||
Path componentPath = *i;
|
||||
|
||||
printMsg(lvlError, format("COMP: %1%") % (*i));
|
||||
|
||||
if(store->isStateComponent(componentPath)){
|
||||
printMsg(lvlError, format("COMP-STATE: %1%") % (*i));
|
||||
|
||||
PathSet stateRefs = queryDerivers(noTxn, componentPath ,"*",getCallingUserName());
|
||||
allStatePaths = mergePathSets(stateRefs, allStatePaths);
|
||||
}
|
||||
}
|
||||
PathSet stateReferences = scanForStateReferences(path, allStatePaths);
|
||||
|
||||
for (PathSet::const_iterator i = allStatePaths.begin(); i != allStatePaths.end(); i++){
|
||||
printMsg(lvlError, format("allStatePaths: %1%") % (*i));
|
||||
}
|
||||
for (PathSet::const_iterator i = stateReferences.begin(); i != stateReferences.end(); i++){
|
||||
printMsg(lvlError, format("stateReferences: %1%") % (*i));
|
||||
}
|
||||
|
||||
/* For debugging, print out the referenced and unreferenced
|
||||
paths. */
|
||||
|
|
@ -1728,7 +1704,6 @@ void DerivationGoal::computeClosure()
|
|||
|
||||
allReferences[path] = references;
|
||||
|
||||
allStateReferences[path] = stateReferences;
|
||||
|
||||
/* If the derivation specifies an `allowedReferences'
|
||||
attribute (containing a list of paths that the output may
|
||||
|
|
@ -1761,6 +1736,50 @@ void DerivationGoal::computeClosure()
|
|||
locks for too long. */
|
||||
Transaction txn;
|
||||
createStoreTransaction(txn);
|
||||
for (DerivationOutputs::iterator i = drv.outputs.begin();
|
||||
i != drv.outputs.end(); ++i)
|
||||
{
|
||||
registerValidPath(txn, i->second.path,
|
||||
contentHashes[i->second.path],
|
||||
allReferences[i->second.path],
|
||||
PathSet(),
|
||||
drvPath);
|
||||
}
|
||||
|
||||
//TODO COMMENT
|
||||
|
||||
for (DerivationOutputs::iterator i = drv.outputs.begin();
|
||||
i != drv.outputs.end(); ++i)
|
||||
{
|
||||
/* For this state-output path, find the references to other paths contained in it.
|
||||
* Get the state paths (instead of out paths) from all components, and then call
|
||||
* scanForStateReferences().
|
||||
*/
|
||||
PathSet allStatePaths;
|
||||
for (PathSet::const_iterator i = allPaths.begin(); i != allPaths.end(); i++){
|
||||
Path componentPath = *i;
|
||||
|
||||
printMsg(lvlError, format("COMP: %1%") % (*i));
|
||||
|
||||
if(store->isStateComponent(componentPath)){
|
||||
printMsg(lvlError, format("COMP-STATE: %1%") % (*i));
|
||||
|
||||
PathSet stateRefs = queryDerivers(noTxn, componentPath ,"*",getCallingUserName());
|
||||
allStatePaths = mergePathSets(stateRefs, allStatePaths);
|
||||
}
|
||||
}
|
||||
PathSet stateReferences = scanForStateReferences(path, allStatePaths);
|
||||
|
||||
for (PathSet::const_iterator i = allStatePaths.begin(); i != allStatePaths.end(); i++){
|
||||
printMsg(lvlError, format("allStatePaths: %1%") % (*i));
|
||||
}
|
||||
for (PathSet::const_iterator i = stateReferences.begin(); i != stateReferences.end(); i++){
|
||||
printMsg(lvlError, format("stateReferences: %1%") % (*i));
|
||||
}
|
||||
|
||||
allStateReferences[path] = stateReferences;
|
||||
}
|
||||
|
||||
for (DerivationOutputs::iterator i = drv.outputs.begin();
|
||||
i != drv.outputs.end(); ++i)
|
||||
{
|
||||
|
|
@ -1770,6 +1789,7 @@ void DerivationGoal::computeClosure()
|
|||
allStateReferences[i->second.path],
|
||||
drvPath);
|
||||
}
|
||||
|
||||
txn.commit();
|
||||
|
||||
/* It is now safe to delete the lock files, since all future
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue