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

* 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:
Eelco Dolstra 2005-01-19 16:59:56 +00:00
parent 96de272b48
commit e0f4e587c3
3 changed files with 33 additions and 18 deletions

View file

@ -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)
{