Blame SOURCES/gzip-1.3.12-openbsd-owl-tmp.patch

fb7e20
--- gzip-1.3.12/znew.in.owl-tmp	2007-06-04 09:15:11.000000000 +0200
fb7e20
+++ gzip-1.3.12/znew.in	2007-06-04 09:23:18.000000000 +0200
fb7e20
@@ -55,28 +55,27 @@
fb7e20
 # block is the disk block size (best guess, need not be exact)
fb7e20
 
fb7e20
 warn="(does not preserve modes and timestamp)"
fb7e20
-tmp=${TMPDIR-/tmp}/zfoo.$$
fb7e20
-set -C
fb7e20
-echo hi > $tmp || exit
fb7e20
-if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then
fb7e20
-  cpmod=${CPMOD-cpmod}
fb7e20
+cpmod= 
fb7e20
+cpmodarg= 
fb7e20
+if type ${CPMOD:-cpmod} 2>/dev/null; then 
fb7e20
+  cpmod=${CPMOD:-cpmod} 
fb7e20
   warn=""
fb7e20
 fi
fb7e20
 
fb7e20
-if test -z "$cpmod" && ${TOUCH-touch} -r $tmp $tmp 2>/dev/null; then
fb7e20
-  cpmod="${TOUCH-touch}"
fb7e20
+if test -z "$cpmod"; then 
fb7e20
+  cpmod=touch 
fb7e20
   cpmodarg="-r"
fb7e20
   warn="(does not preserve file modes)"
fb7e20
 fi
fb7e20
 
fb7e20
-# check if GZIP env. variable uses -S or --suffix
fb7e20
-gzip -q $tmp
fb7e20
-ext=`echo $tmp* | sed "s|$tmp||"`
fb7e20
-rm -f $tmp*
fb7e20
-if test -z "$ext"; then
fb7e20
-  echo znew: error determining gzip extension
fb7e20
-  exit 1
fb7e20
-fi
fb7e20
+case "$GZIP" in                                                                  
fb7e20
+  *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[[:space:]]*\([^[:space:]]*\).*$/\1/'`   
fb7e20
+       ;;                                                                        
fb7e20
+  *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix=\([^[:space:]]*\).*$/\1/'`   
fb7e20
+       ;;                                                                        
fb7e20
+  *) ext='.gz'                                                                   
fb7e20
+       ;;                                                                        
fb7e20
+esac  
fb7e20
 if test "$ext" = ".Z"; then
fb7e20
   echo znew: cannot use .Z as gzip extension.
fb7e20
   exit 1