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

adjusted to: void computeFSClosure(const Path & path, PathSet & paths, const bool & withComponents, const bool & withState, bool flipDirection)

This commit is contained in:
Wouter den Breejen 2007-06-29 15:24:51 +00:00
parent 7eb2f61797
commit c370c9f535
11 changed files with 37 additions and 62 deletions

View file

@ -1499,9 +1499,9 @@ PathSet mergeNewDerivationIntoList(const Path & storepath, const Path & newdrv,
- Source/binary deployment (when called on a derivation with
`includeOutputs' set to true).
*/
void storePathRequisites(const Path & storePath, const bool includeOutputs, PathSet & paths, const bool & withState)
void storePathRequisites(const Path & storePath, const bool includeOutputs, PathSet & paths, const bool & withComponents, const bool & withState)
{
computeFSClosure(storePath, paths, withState);
computeFSClosure(storePath, paths, withComponents, withState);
if (includeOutputs) {
for (PathSet::iterator i = paths.begin();
@ -1511,38 +1511,16 @@ void storePathRequisites(const Path & storePath, const bool includeOutputs, Path
for (DerivationOutputs::iterator j = drv.outputs.begin();
j != drv.outputs.end(); ++j)
if (store->isValidPath(j->second.path))
computeFSClosure(j->second.path, paths, withState);
computeFSClosure(j->second.path, paths, withComponents, withState);
}
}
}
void LocalStore::storePathRequisites(const Path & storePath, const bool includeOutputs, PathSet & paths, const bool & withState)
void LocalStore::storePathRequisites(const Path & storePath, const bool includeOutputs, PathSet & paths, const bool & withComponents, const bool & withState)
{
return nix::storePathRequisites(storePath, includeOutputs, paths, withState);
return nix::storePathRequisites(storePath, includeOutputs, paths, withComponents, withState);
}
/*
* Same as storePathRequisites with withState=true, but now only returns the state paths
*/
void storePathStateRequisitesOnlyTxn(const Transaction & txn, const Path & storePath, const bool includeOutputs, PathSet & statePaths)
{
PathSet paths;
storePathRequisites(storePath, includeOutputs, paths, true);
//filter out all non-state paths
for (PathSet::iterator i = paths.begin(); i != paths.end(); ++i){
if (isValidStatePathTxn(txn, *i))
statePaths.insert(*i);
}
}
void LocalStore::storePathStateRequisitesOnly(const Path & storePath, const bool includeOutputs, PathSet & statePaths)
{
nix::storePathStateRequisitesOnlyTxn(noTxn, storePath, includeOutputs, statePaths);
}
/*
* TODO
*
@ -1576,14 +1554,14 @@ void getDependenciesAtBuildTime(const Transaction & txn, const Path & drvPath)
Derivation inDrv = derivationFromPath(i->first);
for (StringSet::iterator j = i->second.begin(); j != i->second.end(); ++j)
if (inDrv.outputs.find(*j) != inDrv.outputs.end())
computeFSClosure(inDrv.outputs[*j].path, inputPaths, false); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!! WE (MAY) ALSO NEED TO COPY STATE
computeFSClosure(inDrv.outputs[*j].path, inputPaths, true, false); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!! WE (MAY) ALSO NEED TO COPY STATE
else
throw Error(format("derivation `%1%' requires non-existent output `%2%' from input derivation `%3%'") % drvPath % *j % i->first);
}
// Second, the input sources.
for (PathSet::iterator i = drv.inputSrcs.begin(); i != drv.inputSrcs.end(); ++i)
computeFSClosure(*i, inputPaths, false); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!! WE (MAY) ALSO NEED TO COPY STATE
computeFSClosure(*i, inputPaths, true, false); //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!! WE (MAY) ALSO NEED TO COPY STATE
//debug(format("added input paths %1%") % showPaths(inputPaths)); //TODO
allPaths.insert(inputPaths.begin(), inputPaths.end());