SOURCES: gzip-noppid.patch - updated for 1.3.6, avoid one more race
qboosh
qboosh at pld-linux.org
Thu Nov 30 00:42:10 CET 2006
Author: qboosh Date: Wed Nov 29 23:42:10 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated for 1.3.6, avoid one more race
---- Files affected:
SOURCES:
gzip-noppid.patch (1.3 -> 1.4)
---- Diffs:
================================================================
Index: SOURCES/gzip-noppid.patch
diff -u SOURCES/gzip-noppid.patch:1.3 SOURCES/gzip-noppid.patch:1.4
--- SOURCES/gzip-noppid.patch:1.3 Sun Jan 19 02:39:41 2003
+++ SOURCES/gzip-noppid.patch Thu Nov 30 00:42:05 2006
@@ -1,91 +1,48 @@
---- gzip-1.3/gzexe.in.mktemp Tue Jun 5 11:21:43 2001
-+++ gzip-1.3/gzexe.in Tue Jun 5 11:37:48 2001
-@@ -21,7 +21,7 @@
- exit 1
- fi
+--- gzip-1.3.6/gzexe.in.orig 2006-11-29 23:57:02.074114000 +0100
++++ gzip-1.3.6/gzexe.in 2006-11-29 23:57:02.094115250 +0100
+@@ -67,7 +67,7 @@
+ esac
+ done
-tmp=gz$$
+tmp=`mktemp gz.XXXXXX` || exit 1
trap "rm -f $tmp; exit 1" 1 2 3 5 10 13 15
- decomp=0
-@@ -32,12 +32,14 @@
- shift
- fi
-
--echo hi > zfoo1$$
--echo hi > zfoo2$$
--if test -z "`(${CPMOD-cpmod} zfoo1$$ zfoo2$$) 2>&1`"; then
-+zfoo=`mktemp zfoo.XXXXXX` || exit 1
-+zbar=`mktemp zbar.XXXXXX` || exit 1
-+echo hi > $zfoo
-+echo hi > $zbar
-+if test -z "`(${CPMOD-cpmod} $zfoo $zbar) 2>&1`"; then
- cpmod=${CPMOD-cpmod}
- fi
--rm -f zfoo[12]$$
-+rm -f $zfoo $zbar
-
- tail=""
- IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
---- gzip-1.3.5/zdiff.in.mktemp Tue Jun 5 11:41:15 2001
-+++ gzip-1.3.5/zdiff.in Tue Jun 5 12:22:06 2001
-@@ -47,11 +47,12 @@
+ set -C
+--- gzip-1.3.6/zdiff.in.orig 2006-11-29 23:57:02.078114250 +0100
++++ gzip-1.3.6/zdiff.in 2006-11-30 00:06:39.394194250 +0100
+@@ -60,11 +60,12 @@
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'`
set -C
- trap 'rm -f /tmp/"$F".$$; exit 2' HUP INT PIPE TERM 0
-- gzip -cdfq "$2" > /tmp/"$F".$$ || exit
-- gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$
-+ tmpfile=`mktemp -u ${TMPDIR:-/tmp}/gz.XXXXXX` || exit 1
+- gzip -cdfq -- "$2" > /tmp/"$F".$$ || exit
+- gzip -cdfq -- "$1" | $comp $OPTIONS - /tmp/"$F".$$
++ tmpfile=`mktemp ${TMPDIR:-/tmp}/gz.XXXXXX` || exit 1
+ trap 'rm -f $tmpfile; exit 2' HUP INT PIPE TERM 0
-+ gzip -cdfq "$2" > $tmpfile || exit
-+ gzip -cdfq "$1" | $comp $OPTIONS - $tmpfile
++ gzip -cdfq -- "$2" >| $tmpfile || exit
++ gzip -cdfq -- "$1" | $comp $OPTIONS - $tmpfile
STAT="$?"
- /bin/rm -f /tmp/"$F".$$ || STAT=2
+ /bin/rm -f $tmpfile || STAT=2
trap - HUP INT PIPE TERM 0
exit $STAT;;
---- gzip-1.3/znew.in.mktemp Tue Jun 5 11:41:24 2001
-+++ gzip-1.3/znew.in Tue Jun 5 12:34:54 2001
-@@ -14,25 +14,27 @@
+--- gzip-1.3.6/znew.in.orig 2006-11-29 23:57:02.082114500 +0100
++++ gzip-1.3.6/znew.in 2006-11-30 00:09:00.795031250 +0100
+@@ -56,9 +56,9 @@
# block is the disk block size (best guess, need not be exact)
warn="(does not preserve modes and timestamp)"
-tmp=/tmp/zfoo.$$
-+tmp1=`mktemp -u ${TMPDIR:-/tmp}/gz.XXXXXX` || exit 1
-+tmp2=`mktemp -u ${TMPDIR:-/tmp}/gz.XXXXXX` || exit 1
-+
++tmp=`mktemp ${TMPDIR:-/tmp}/zfoo.XXXXXX` || exit 1
set -C
--echo hi > $tmp.1
--echo hi > $tmp.2
--if test -z "`(${CPMOD-cpmod} $tmp.1 $tmp.2) 2>&1`"; then
-+echo hi > $tmp1
-+echo hi > $tmp2
-+if test -z "`(${CPMOD-cpmod} $tmp1 $tmp2) 2>&1`"; then
+-echo hi > $tmp || exit
++echo hi >| $tmp || exit
+ if test -z "`(${CPMOD-cpmod} $tmp $tmp) 2>&1`"; then
cpmod=${CPMOD-cpmod}
warn=""
- fi
-
--if test -z "$cpmod" && ${TOUCH-touch} -r $tmp.1 $tmp.2 2>/dev/null; then
-+if test -z "$cpmod" && ${TOUCH-touch} -r $tmp1 $tmp2 2>/dev/null; then
- cpmod="${TOUCH-touch}"
- cpmodarg="-r"
- warn="(does not preserve file modes)"
- fi
-
- # check if GZIP env. variable uses -S or --suffix
--gzip -q $tmp.1
--ext=`echo $tmp.1* | sed "s|$tmp.1||"`
--rm -f $tmp.[12]*
-+gzip -q $tmp1
-+ext=`echo $tmp1* | sed "s|$tmp1||"`
-+rm -f $tmp1 $tmp2
- if test -z "$ext"; then
- echo znew: error determining gzip extension
- exit 1
-@@ -77,6 +79,7 @@
+@@ -114,6 +114,7 @@
for i do
n=`echo $i | sed 's/.Z$//'`
@@ -93,7 +50,7 @@
if test ! -f "$n.Z" ; then
echo $n.Z not found
res=1; continue
-@@ -92,7 +95,7 @@
+@@ -129,7 +130,7 @@
fi
else
if test $check -eq 1; then
@@ -102,7 +59,7 @@
:
else
echo cannot backup "$n.Z"
-@@ -102,7 +105,7 @@
+@@ -139,7 +140,7 @@
if gzip -d "$n.Z"; then
:
else
@@ -111,7 +68,7 @@
echo error while uncompressing $n.Z
res=1; continue
fi
-@@ -110,7 +113,7 @@
+@@ -147,7 +148,7 @@
:
else
if test $check -eq 1; then
@@ -120,7 +77,7 @@
echo error while recompressing $n
else
# compress $n (might be dangerous if disk full)
-@@ -125,7 +128,7 @@
+@@ -162,7 +163,7 @@
if test $pipe -eq 1; then
rm -f "$n$ext"
elif test $check -eq 1; then
@@ -129,7 +86,7 @@
else
gzip -d "$n$ext" && compress "$n" && rm -f "$n$ext"
fi
-@@ -133,9 +136,9 @@
+@@ -170,9 +171,9 @@
elif test $check -eq 1; then
if gzip -t "$n$ext" ; then
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/gzip-noppid.patch?r1=1.3&r2=1.4&f=u
More information about the pld-cvs-commit
mailing list