diff options
author | Rob Landley <rob@landley.net> | 2014-06-08 14:01:37 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2014-06-08 14:01:37 -0500 |
commit | 298fcd94d21413a80a5e5a0684c6fc2397fc95b3 (patch) | |
tree | a0dc33c97f0236367fa052d1b969da6a76ba2515 /scripts | |
parent | 0fe882b375253308de34f8a912d006021c1ac48f (diff) | |
download | toybox-298fcd94d21413a80a5e5a0684c6fc2397fc95b3.tar.gz |
Isaac Dunham also reported that some diff implementations can't handle nonseekable input, so write to a temporary file instead of <(command).
Use trap EXIT to make sure the temporary files get deleted.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bloatcheck | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/bloatcheck b/scripts/bloatcheck index d18fbe08..fff4690f 100755 --- a/scripts/bloatcheck +++ b/scripts/bloatcheck @@ -58,6 +58,10 @@ do_bloatcheck() printf "% 71d total\n" "$TOTAL" } -diff -U 0 <(nm --size-sort "$1" | sort -k3,3) \ - <(nm --size-sort "$2" | sort -k3,3) \ - | tail -n +3 | sed -n 's/^\([-+]\)/\1 /p' | sort -k4,4 | do_bloatcheck +DIFF1=`mktemp base.XXXXXXX` +DIFF2=`mktemp bloat.XXXXXXX` +trap "rm $DIFF1 $DIFF2" EXIT +nm --size-sort "$1" | sort -k3,3 > $DIFF1 +nm --size-sort "$2" | sort -k3,3 > $DIFF2 +diff -U 0 $DIFF1 $DIFF2 | tail -n +3 | sed -n 's/^\([-+]\)/\1 /p' \ + | sort -k4,4 | do_bloatcheck |