nixpkgs/pkgs/build-support/nuke-references/builder.sh
Shea Levy 9afc1f6a24 nuke-refs: Don't assume /nix/store
svn path=/nixpkgs/trunk/; revision=30090
2011-10-28 21:23:40 +00:00

15 lines
361 B
Bash

source $stdenv/setup
ensureDir $out/bin
cat > $out/bin/nuke-refs <<EOF
#! $SHELL -e
for i in \$*; do
if test ! -L \$i -a -f \$i; then
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
fi
done
EOF
chmod +x $out/bin/nuke-refs