SHA256
1
0
forked from pool/gzip
gzip/tempfile.diff
OBS User autobuild c7c6ba1ff6 Accepting request 30400 from Base:System
Copy from Base:System/gzip based on submit request 30400 from user mseben

OBS-URL: https://build.opensuse.org/request/show/30400
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gzip?expand=0&rev=13
2010-01-29 14:00:15 +00:00

27 lines
750 B
Diff

Index: znew.in
===================================================================
--- znew.in.orig
+++ znew.in
@@ -59,8 +59,9 @@ block=1024
# block is the disk block size (best guess, need not be exact)
warn="(does not preserve modes and timestamp)"
-tmp=${TMPDIR-/tmp}/zfoo.$$
-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}
@@ -76,7 +77,8 @@ fi
# 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