summaryrefslogtreecommitdiff
path: root/contrib/dg-cmp-results.sh
diff options
context:
space:
mode:
authorYury Gribov <tetra2005@gmail.com>2018-02-19 08:03:17 +0000
committerYury Gribov <ygribov@gcc.gnu.org>2018-02-19 08:03:17 +0000
commit9f88a07b85a2922ab1d7ae8ec02b18aa739af32a (patch)
treefef1350623f9a73d1344aca2a44f417eaa7333eb /contrib/dg-cmp-results.sh
parente2b7efbf2790d7c12c0489446b0b27b2cde12bab (diff)
downloadgcc-9f88a07b85a2922ab1d7ae8ec02b18aa739af32a.tar.gz
Respect TMPDIR in contrib scripts.
2018-02-18 Yury Gribov <tetra2005@gmail.com> contrib/ * compare_tests: Use TMPDIR when set. * dg-cmp-results.sh: Ditto. * warn_summary: Ditto. From-SVN: r257801
Diffstat (limited to 'contrib/dg-cmp-results.sh')
-rwxr-xr-xcontrib/dg-cmp-results.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/dg-cmp-results.sh b/contrib/dg-cmp-results.sh
index 5f2fed5ec3f..821d557a168 100755
--- a/contrib/dg-cmp-results.sh
+++ b/contrib/dg-cmp-results.sh
@@ -63,6 +63,7 @@ OFILE="$2"
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 @@ sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
-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 @@ sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
-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 @@ END {
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