1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

* `nix-store -qb' to query derivation environment bindings. Useful

for finding build-time dependencies (possibly after a build).  E.g.,

    $ nix-store -qb aterm $(nix-store -qd $(which strc))
    /nix/store/jw7c7s65n1gwhxpn35j9rgcci6ilzxym-aterm-2.3.1

* Arguments to nix-store can be files within store objects, e.g.,
  /nix/store/jw7c...-aterm-2.3.1/bin/baffle.

* Idem for garbage collector roots.
This commit is contained in:
Eelco Dolstra 2005-02-07 14:32:44 +00:00
parent 450c358e20
commit fbc434ee4c
4 changed files with 60 additions and 16 deletions

View file

@ -60,7 +60,7 @@ void createSymlink(const Path & link, const Path & target, bool careful)
/* Remove the old symlink. */
if (pathExists(link)) {
if (careful && (!isLink(link) || !isStorePath(readLink(link))))
if (careful && (!isLink(link) || !isInStore(readLink(link))))
throw Error(format("cannot create symlink `%1%'; already exists") % link);
unlink(link.c_str());
}
@ -250,10 +250,10 @@ static void findRoots(const Path & path, bool recurseSymlinks,
string target = readLink(path);
Path target2 = absPath(target, dirOf(path));
if (isStorePath(target2)) {
if (isInStore(target2)) {
debug(format("found root `%1%' in `%2%'")
% target2 % path);
roots.insert(target2);
roots.insert(toStorePath(target2));
}
else if (recurseSymlinks) {