diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-03-24T17·49+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-03-24T17·49+0000 |
commit | 73c53935d00660301e9408beabf1c80d6ef48610 (patch) | |
tree | 35fe4c71ed019be41983ca6ae37f86fc327c4c3c /src/nix-addroot | |
parent | eeab86e0acbb32cdb360443dd6efe7031fed7295 (diff) |
* For efficiency: md5 integrated into nix.
* Command `nix ensure' which is like `nix getpkg' except that if the has refers to a run action it will just ensure that the imports are there. * Command `nix closure' to print out the closure of the set of descriptors under the import relation, starting at a set of roots. This can be used for garbage collection (e.g., given a list of `activated' packages, we can delete all packages not reachable from those). * Command `nix graph' to print out a Dot graph of the dependency graph. * `nix-addroot' adds a root for the (unimplemented) garbage collector.
Diffstat (limited to 'src/nix-addroot')
-rwxr-xr-x | src/nix-addroot | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nix-addroot b/src/nix-addroot new file mode 100755 index 000000000000..3ab9e8a252f8 --- /dev/null +++ b/src/nix-addroot @@ -0,0 +1,18 @@ +#! /bin/sh + +ROOTLIST=~/.nixroots + +if ! test -f $ROOTLIST; then + touch $ROOTLIST +fi + +for i in $*; do + if nix ensure $i > /dev/null; then + if grep -q $i $ROOTLIST; then + echo $i already is a root + else + echo adding root $i + echo $i >> $ROOTLIST + fi + fi +done |