Nix/src/nix-addroot
Eelco Dolstra 73c53935d0 * 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.
2003-03-24 17:49:56 +00:00

19 lines
291 B
Bash
Executable file

#! /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