Add nix-strace.sh (wip)

This commit is contained in:
Matthew Bauer 2017-04-29 19:53:49 -05:00
parent 1584ab8dc4
commit 0b1596c3d1

12
nix-strace.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
pkg="$1"
shift
exe="$1"
shift
bin=$(mktemp)
out=$(mktemp)
~/nix.sh ./nix-bundle.sh $pkg $exe > $bin
chmod +x $bin
strace -f -o $out $bin $@
cat $out | grep -E '^[0-9]+ open\("\.?\/nix' | grep -Ev " = -[0-9]+ [A-Z]+ \([a-zA-Z ]+\)$" | sed -E 's/^[0-9]+ open\("\.?([^\"]+)".*/\1/'