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

46 lines
1.5 KiB
Diff
Raw Normal View History

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