diff contrib/dg-cmp-results.sh @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line diff
--- a/contrib/dg-cmp-results.sh	Fri Oct 27 22:46:09 2017 +0900
+++ b/contrib/dg-cmp-results.sh	Thu Oct 25 07:37:49 2018 +0900
@@ -63,6 +63,7 @@
 OBASE=`basename "$2"`
 NFILE="$3"
 NBASE=`basename "$3"`
+TMPDIR=${TMPDIR:-/tmp}
 
 echo "dg-cmp-results.sh: Verbosity is ${verbose}, Variant is \"${VARIANT}\""
 echo
@@ -97,7 +98,7 @@
   -e 's/^/O:/' \
   $OFILE |
   sort -s -t : -k 3b - \
-  >/tmp/o$$-$OBASE
+  >$TMPDIR/o$$-$OBASE
 
 # Create a temporary file from the new file's interesting section.
 sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
@@ -107,7 +108,7 @@
   -e 's/^/N:/' \
   $NFILE |
   sort -s -t : -k 3b - \
-  >/tmp/n$$-$NBASE
+  >$TMPDIR/n$$-$NBASE
 
 # Merge the two files, then compare adjacent lines.
 # Comparison is complicated by tests that may be run multiple times.
@@ -200,10 +201,10 @@
     while (old = peek()) compare("", "")
 }
 EOF
-sort -m -s -t : -k 3b /tmp/o$$-$OBASE /tmp/n$$-$NBASE |
+sort -m -s -t : -k 3b $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE |
  awk -v verbose=$verbose -f compare-$$.awk /dev/stdin
 
 # Delete the temporary files.
-rm -f compare-$$.awk /tmp/o$$-$OBASE /tmp/n$$-$NBASE
+rm -f compare-$$.awk $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE
 
 exit 0