From 5671fac19279c96685bcae8a10df44b0fbaafdb3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 25 Mar 2016 12:57:05 -0700 Subject: [PATCH] Port to NetBSD 7.0 Problem reported by Assaf Gordon in: http://bugs.gnu.org/23107#13 * gzexe.in, zdiff.in, zgrep.in: Don't rely on mktemp -t, as it has a different meaning in NetBSD. --- gzexe.in | 4 ++-- zdiff.in | 4 ++-- zgrep.in | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gzexe.in b/gzexe.in index b333993..282e385 100644 --- a/gzexe.in +++ b/gzexe.in @@ -119,7 +119,7 @@ for i do mktemp_status=$? fi if test $mktemp_status -eq 0; then - tmp=`TMPDIR=$dir mktemp -t gzexeXXXXXX` + tmp=`TMPDIR=$dir mktemp` else tmp=$dir/gzexe$$ fi && { cp -p "$file" "$tmp" 2>/dev/null || cp "$file" "$tmp"; } || { @@ -157,7 +157,7 @@ trap 'res=$? ' 0 1 2 3 5 10 13 15 if type mktemp >/dev/null 2>&1; then - gztmpdir=`mktemp -dt` + gztmpdir=`mktemp -d` else gztmpdir=/tmp/gztmp$$; mkdir $gztmpdir fi || { (exit 127); exit 127; } diff --git a/zdiff.in b/zdiff.in index f2f5435..12de3a1 100644 --- a/zdiff.in +++ b/zdiff.in @@ -111,15 +111,15 @@ elif test $# -eq 2; then esac (exit $cmp_status) else - F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog tmp= trap ' test -n "$tmp" && rm -f "$tmp" (exit 2); exit 2 ' HUP INT PIPE TERM 0 if type mktemp >/dev/null 2>&1; then - tmp=`mktemp -t -- "$F.XXXXXX"` || exit 2 + tmp=`mktemp` || exit 2 else + F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog set -C tmp=${TMPDIR-/tmp}/$F.$$ fi diff --git a/zgrep.in b/zgrep.in index 99ace59..7ce45ae 100644 --- a/zgrep.in +++ b/zgrep.in @@ -134,7 +134,7 @@ while test $# -ne 0; do (exit 2); exit 2 ' HUP INT PIPE TERM 0 if type mktemp >/dev/null 2>&1; then - pattmp=$(mktemp -t -- "zgrep.XXXXXX") || exit 2 + pattmp=$(mktemp) || exit 2 else set -C pattmp=${TMPDIR-/tmp}/zgrep.$$ -- 2.11.4.GIT