* Nix-store queries --references' and referers' to query the pointer
graph. That is, `nix-store --query --references PATH' shows the set of paths referenced by PATH, and `nix-store --query --referers PATH' shows the set of paths referencing PATH.
This commit is contained in:
parent
96de272b48
commit
e0f4e587c3
3 changed files with 33 additions and 18 deletions
|
|
@ -272,6 +272,16 @@ void queryReferences(const Path & storePath, PathSet & references)
|
|||
}
|
||||
|
||||
|
||||
void queryReferers(const Path & storePath, PathSet & referers)
|
||||
{
|
||||
Paths referers2;
|
||||
if (!isValidPath(storePath))
|
||||
throw Error(format("path `%1%' is not valid") % storePath);
|
||||
nixDB.queryStrings(noTxn, dbReferers, storePath, referers2);
|
||||
referers.insert(referers2.begin(), referers2.end());
|
||||
}
|
||||
|
||||
|
||||
static Substitutes readSubstitutes(const Transaction & txn,
|
||||
const Path & srcPath)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,6 +84,10 @@ void setReferences(const Transaction & txn, const Path & storePath,
|
|||
result is not cleared. */
|
||||
void queryReferences(const Path & storePath, PathSet & references);
|
||||
|
||||
/* Queries the set of incoming FS references for a store path. The
|
||||
result is not cleared. */
|
||||
void queryReferers(const Path & storePath, PathSet & referers);
|
||||
|
||||
/* Constructs a unique store path name. */
|
||||
Path makeStorePath(const string & type,
|
||||
const Hash & hash, const string & suffix);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue