mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 20:20:58 +01:00
Partially integrated state components (startscripts) into nix-env
This commit is contained in:
parent
13f321e397
commit
7424d72098
17 changed files with 241 additions and 122 deletions
|
|
@ -2587,6 +2587,9 @@ void LocalStore::buildDerivations(const PathSet & drvPaths)
|
|||
Worker worker;
|
||||
Goals goals;
|
||||
for (PathSet::const_iterator i = drvPaths.begin(); i != drvPaths.end(); ++i){
|
||||
|
||||
printMsg(lvlError, format("BUILD: '%1%'") % *i);
|
||||
|
||||
goals.insert(worker.makeDerivationGoal(*i));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ struct DerivationStateOutput
|
|||
throw Error(format("synchronization '%1%' is not a correct type") % synchronization);
|
||||
if(username == "")
|
||||
throw Error(format("Username cannot be empty"));
|
||||
if(stateIdentifier == "__EMTPY__" || stateIdentifier == "__NOSTATE__")
|
||||
throw Error(format("the stateIdenfier cannot be this value '%1%'") % stateIdentifier);
|
||||
}
|
||||
|
||||
//TODO
|
||||
|
|
|
|||
|
|
@ -768,19 +768,19 @@ void addStateDeriver(const Transaction & txn, const Path & storePath, const Path
|
|||
* Returns true or false wheter a store-component has a state component (e.g. has a state dir) or not.
|
||||
* Do NOT confuse this function with isValidStatePath
|
||||
*/
|
||||
bool isStateComponentTxn(const Transaction & txn, const Path & statePath)
|
||||
bool isStateComponentTxn(const Transaction & txn, const Path & storePath)
|
||||
{
|
||||
isValidPathTxn(txn, statePath);
|
||||
isValidPathTxn(txn, storePath);
|
||||
|
||||
string data;
|
||||
bool nonempty = nixDB.queryString(txn, dbStateInfo, statePath, data);
|
||||
bool nonempty = nixDB.queryString(txn, dbStateInfo, storePath, data);
|
||||
|
||||
return nonempty;
|
||||
}
|
||||
|
||||
bool LocalStore::isStateComponent(const Path & statePath)
|
||||
bool LocalStore::isStateComponent(const Path & storePath)
|
||||
{
|
||||
return nix::isStateComponentTxn(noTxn, statePath);
|
||||
return nix::isStateComponentTxn(noTxn, storePath);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public:
|
|||
|
||||
vector<int> getStatePathsInterval(const PathSet & statePaths);
|
||||
|
||||
bool isStateComponent(const Path & path);
|
||||
bool isStateComponent(const Path & storePath);
|
||||
|
||||
bool isStateDrvPath(const Path & drvpath);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue