2010-01-29 15:00:15 +01:00
|
|
|
Index: znew.in
|
|
|
|
===================================================================
|
|
|
|
--- znew.in.orig
|
2006-12-15 18:09:13 +01:00
|
|
|
+++ znew.in
|
2010-01-29 15:00:15 +01:00
|
|
|
@@ -59,8 +59,9 @@ block=1024
|
2006-12-15 18:09:13 +01:00
|
|
|
# block is the disk block size (best guess, need not be exact)
|
|
|
|
|
|
|
|
warn="(does not preserve modes and timestamp)"
|
2007-04-15 10:49:40 +02:00
|
|
|
-tmp=${TMPDIR-/tmp}/zfoo.$$
|
2006-12-15 18:09:13 +01:00
|
|
|
-set -C
|
|
|
|
+dtmp=`mktemp -d -t znew.XXXXXXXX` || exit
|
|
|
|
+trap 'rm -rf $dtmp' HUP INT PIPE TERM 0
|
|
|
|
+tmp=$dtmp/znew
|
|
|
|
echo hi > $tmp || exit
|
|
|
|
if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then
|
|
|
|
cpmod=${CPMOD-cpmod}
|
2010-01-29 15:00:15 +01:00
|
|
|
@@ -76,7 +77,8 @@ fi
|
2006-12-15 18:09:13 +01:00
|
|
|
# check if GZIP env. variable uses -S or --suffix
|
|
|
|
gzip -q $tmp
|
|
|
|
ext=`echo $tmp* | sed "s|$tmp||"`
|
|
|
|
-rm -f $tmp*
|
|
|
|
+rm -f $dtmp
|
|
|
|
+trap - HUP INT PIPE TERM 0
|
|
|
|
if test -z "$ext"; then
|
|
|
|
echo znew: error determining gzip extension
|
|
|
|
exit 1
|