diff options
| author | cvs2svn <cvs2svn@FreeBSD.org> | 2002-02-04 19:23:43 +0000 |
|---|---|---|
| committer | cvs2svn <cvs2svn@FreeBSD.org> | 2002-02-04 19:23:43 +0000 |
| commit | c2429c497266c4f8c5ec071118e956758aa4af13 (patch) | |
| tree | 27eca0badfcdd1d8d0284d534696abb4195a9eba /gnu | |
| parent | b3ea8abeca50df2e24167770d1e7484f1f877a7d (diff) | |
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/gzip/zdiff | 7 | ||||
| -rw-r--r-- | gnu/usr.bin/gzip/znew | 20 |
2 files changed, 11 insertions, 16 deletions
diff --git a/gnu/usr.bin/gzip/zdiff b/gnu/usr.bin/gzip/zdiff index 310a201e1a34..ebc9eca485a3 100644 --- a/gnu/usr.bin/gzip/zdiff +++ b/gnu/usr.bin/gzip/zdiff @@ -47,11 +47,10 @@ elif test $# -eq 2; then case "$2" in *[-.]gz* | *[-.][zZ] | *.t[ga]z) F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'` - tmp=`mktemp -t "$F"` - gzip -cdfq "$2" > "$tmp" - gzip -cdfq "$1" | $comp $OPTIONS - "$tmp" + gzip -cdfq "$2" > /tmp/"$F".$$ + gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$ STAT="$?" - /bin/rm -f "$tmp";; + /bin/rm -f /tmp/"$F".$$;; *) gzip -cdfq "$1" | $comp $OPTIONS - "$2" STAT="$?";; diff --git a/gnu/usr.bin/gzip/znew b/gnu/usr.bin/gzip/znew index 52b0ae963c2f..8e0e26bc76bd 100644 --- a/gnu/usr.bin/gzip/znew +++ b/gnu/usr.bin/gzip/znew @@ -14,28 +14,24 @@ block=1024 # block is the disk block size (best guess, need not be exact) warn="(does not preserve modes and timestamp)" -tmp=`mktemp -d -t znew` -if test -z "$tmp"; then - echo znew: could not create temporary directory - exit 1 -fi -echo hi > $tmp/1 -echo hi > $tmp/2 -if test -z "`(${CPMOD-cpmod} $tmp/1 $tmp/2) 2>&1`"; then +tmp=/tmp/zfoo.$$ +echo hi > $tmp.1 +echo hi > $tmp.2 +if test -z "`(${CPMOD-cpmod} $tmp.1 $tmp.2) 2>&1`"; then cpmod=${CPMOD-cpmod} warn="" fi -if test -z "$cpmod" && ${TOUCH-touch} -r $tmp/1 $tmp/2 2>/dev/null; then +if test -z "$cpmod" && ${TOUCH-touch} -r $tmp.1 $tmp.2 2>/dev/null; then cpmod="${TOUCH-touch}" cpmodarg="-r" warn="(does not preserve file modes)" fi # check if GZIP env. variable uses -S or --suffix -gzip -q $tmp/1 -ext=`echo $tmp/1* | sed "s|$tmp/1||"` -rm -rf $tmp +gzip -q $tmp.1 +ext=`echo $tmp.1* | sed "s|$tmp.1||"` +rm -f $tmp.[12]* if test -z "$ext"; then echo znew: error determining gzip extension exit 1 |
