cnd / rpms / gzip

Forked from rpms/gzip 3 years ago
Clone

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

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