From e695ccf394f87927da6b3591ce85aa6ad7c20619 Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Tue, 26 Jan 2016 14:24:11 -0500 Subject: compare_tests: Use nawk(1) on illumos, since awk(1) is old and bad --- contrib/compare_tests | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/contrib/compare_tests b/contrib/compare_tests index 2dfa8640756..6616a201f23 100755 --- a/contrib/compare_tests +++ b/contrib/compare_tests @@ -108,8 +108,15 @@ elif [ -d "$1" -o -d "$2" ] ; then usage "Must specify either two directories or two files" fi -sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$1" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp1 -sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$2" | awk '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp2 +osrev=`uname -sr` +if [ `expr "$osrev" : "SunOS 5."` -eq "8" ]; then + AWK=/usr/bin/nawk +else + AWK=awk +fi + +sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$1" | $AWK '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp1 +sed 's/^XFAIL/FAIL/; s/^ERROR/FAIL/; s/^XPASS/PASS/' < "$2" | $AWK '/^Running target / {target = $3} { if (target != "unix") { sub(/: /, "&"target": " ); }; print $0; }' | cut -c1-2000 >$tmp2 before=$tmp1 now=$tmp2