* Turn the nukeRefs() function into a separate program.

svn path=/nixpkgs/trunk/; revision=6941
This commit is contained in:
Eelco Dolstra 2006-11-03 13:33:24 +00:00
parent d0a18cf8fa
commit 609607768f
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,12 @@
source $stdenv/setup
ensureDir $out/bin
cat > $out/bin/nuke-refs <<EOF
#! $SHELL -e
for i in \$*; do
cat \$i | sed "s|/nix/store/[a-z0-9]*-|/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > \$i.tmp
if test -x \$i; then chmod +x \$i.tmp; fi
mv \$i.tmp \$i
done
EOF
chmod +x $out/bin/nuke-refs

View File

@ -0,0 +1,11 @@
# The program `nuke-refs' created by this derivation replaces all
# references to the Nix store in the specified files by a non-existant
# path (/nix/store/eeee...). This is useful for getting rid of
# dependencies that you know are not actually needed at runtime.
{stdenv}:
stdenv.mkDerivation {
name = "nuke-references";
builder = ./builder.sh;
}

View File

@ -192,6 +192,10 @@ rec {
inherit stdenv;
};
nukeReferences = import ../build-support/nuke-references/default.nix {
inherit stdenv;
};
### TOOLS