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

fix for queryStoreReferences

This commit is contained in:
Wouter den Breejen 2007-10-18 12:08:53 +00:00
parent 84d00db70b
commit a699c6b330
11 changed files with 132 additions and 53 deletions

View file

@ -401,12 +401,10 @@ bool LocalStore::isValidComponentOrStatePath(const Path & path)
void setReferences(const Transaction & txn, const Path & store_or_statePath,
const PathSet & references, const PathSet & stateReferences, const unsigned int revision)
{
/* For unrealisable paths, we can only clear the references. */
if (references.size() > 0 && !isValidComponentOrStatePathTxn(txn, store_or_statePath))
throw Error(format("cannot set references for path `%1%' which is invalid and has no substitutes") % store_or_statePath);
/*
for (PathSet::iterator i = references.begin(); i != references.end(); ++i)
printMsg(lvlError, format("'%2%' has references: %1%") % *i % store_or_statePath);
@ -483,14 +481,14 @@ void queryXReferencesTxn(const Transaction & txn, const Path & store_or_statePat
references.insert(references2.begin(), references2.end());
}
void LocalStore::queryStoreReferences(const Path & storePath, PathSet & references, const unsigned int revision)
void LocalStore::queryStoreReferences(const Path & componentOrstatePath, PathSet & references, const unsigned int revision)
{
nix::queryXReferencesTxn(noTxn, storePath, references, revision, true);
nix::queryXReferencesTxn(noTxn, componentOrstatePath, references, true, revision);
}
void LocalStore::queryStateReferences(const Path & componentOrstatePath, PathSet & stateReferences, const unsigned int revision)
{
nix::queryXReferencesTxn(noTxn, componentOrstatePath, stateReferences, revision, false);
nix::queryXReferencesTxn(noTxn, componentOrstatePath, stateReferences, false, revision);
}
//Private