aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2014-06-08 14:01:37 -0500
committerRob Landley <rob@landley.net>2014-06-08 14:01:37 -0500
commit298fcd94d21413a80a5e5a0684c6fc2397fc95b3 (patch)
treea0dc33c97f0236367fa052d1b969da6a76ba2515 /scripts
parent0fe882b375253308de34f8a912d006021c1ac48f (diff)
downloadtoybox-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-xscripts/bloatcheck10
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