mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
5.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/gzip/gzip-1.3.5-openbsd-owl-tmp.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- gzip-1.3.5/znew.in.owl-tmp 2002-09-27 08:17:09.000000000 +0200
  20. +++ gzip-1.3.5/znew.in 2005-03-21 18:15:37.956717675 +0100
  21. @@ -14,29 +14,27 @@
  22. # block is the disk block size (best guess, need not be exact)
  23. warn="(does not preserve modes and timestamp)"
  24. -tmp=/tmp/zfoo.$$
  25. -set -C
  26. -echo hi > $tmp.1
  27. -echo hi > $tmp.2
  28. -if test -z "`(${CPMOD-cpmod} $tmp.1 $tmp.2) 2>&1`"; then
  29. - cpmod=${CPMOD-cpmod}
  30. +cpmod=
  31. +cpmodarg=
  32. +if type ${CPMOD:-cpmod} 2>/dev/null; then
  33. + cpmod=${CPMOD:-cpmod}
  34. warn=""
  35. fi
  36. -if test -z "$cpmod" && ${TOUCH-touch} -r $tmp.1 $tmp.2 2>/dev/null; then
  37. - cpmod="${TOUCH-touch}"
  38. +if test -z "$cpmod"; then
  39. + cpmod=touch
  40. cpmodarg="-r"
  41. warn="(does not preserve file modes)"
  42. fi
  43. -# check if GZIP env. variable uses -S or --suffix
  44. -gzip -q $tmp.1
  45. -ext=`echo $tmp.1* | sed "s|$tmp.1||"`
  46. -rm -f $tmp.[12]*
  47. -if test -z "$ext"; then
  48. - echo znew: error determining gzip extension
  49. - exit 1
  50. -fi
  51. +case "$GZIP" in
  52. + *-S*) ext=`echo "$GZIP" | sed 's/^.*-S[[:space:]]*\([^[:space:]]*\).*$/\1/'`
  53. + ;;
  54. + *-suffix*) ext=`echo "$GZIP" | sed 's/^.*--suffix=\([^[:space:]]*\).*$/\1/'`
  55. + ;;
  56. + *) ext='.gz'
  57. + ;;
  58. +esac
  59. if test "$ext" = ".Z"; then
  60. echo znew: cannot use .Z as gzip extension.
  61. exit 1
  62. --- gzip-1.3.5/gzexe.in.owl-tmp 2002-09-28 08:18:11.000000000 +0200
  63. +++ gzip-1.3.5/gzexe.in 2005-03-21 18:25:32.932597213 +0100
  64. @@ -34,7 +34,7 @@
  65. PATH="BINDIR:$PATH"
  66. -x=`basename $0`
  67. +x=`basename "$0"`
  68. if test $# = 0; then
  69. echo compress executables. original file foo is renamed to foo~
  70. echo usage: ${x} [-d] files...
  71. @@ -42,8 +42,9 @@
  72. exit 1
  73. fi
  74. -tmp=gz$$
  75. -trap "rm -f $tmp; exit 1" 1 2 3 5 10 13 15
  76. +tmp=`/bin/mktemp ${TMPDIR:-/tmp}/gzexe.XXXXXXXXXX` || exit 1
  77. +trap "rm -f $tmp; exit 1" HUP INT QUIT PIPE TERM
  78. +trap "rm -f $tmp; exit 0" EXIT
  79. decomp=0
  80. res=0
  81. @@ -53,12 +54,10 @@
  82. shift
  83. fi
  84. -echo hi > zfoo1$$
  85. -echo hi > zfoo2$$
  86. -if test -z "`(${CPMOD-cpmod} zfoo1$$ zfoo2$$) 2>&1`"; then
  87. - cpmod=${CPMOD-cpmod}
  88. +cpmod=
  89. +if type ${CPMOD:-cpmod} 2>/dev/null; then
  90. + cpmod=${CPMOD:-cpmod}
  91. fi
  92. -rm -f zfoo[12]$$
  93. tail=""
  94. IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
  95. @@ -99,7 +98,7 @@
  96. continue
  97. fi
  98. case "`basename $i`" in
  99. - gzip | tail | sed | chmod | ln | sleep | rm)
  100. + bash | chmod | gzip | ln | mktemp | rm | sed | sh | tail)
  101. echo "${x}: $i would depend on itself"; continue ;;
  102. esac
  103. if test -z "$cpmod"; then
  104. @@ -112,27 +111,19 @@
  105. fi
  106. fi
  107. if test $decomp -eq 0; then
  108. - sed 1q $0 > $tmp
  109. + sed 1q "$0" > $tmp
  110. sed "s|^if tail|if $tail|" >> $tmp <<'EOF'
  111. -skip=22
  112. -set -C
  113. -umask=`umask`
  114. -umask 77
  115. -if tail +$skip "$0" | "BINDIR"/gzip -cd > /tmp/gztmp$$; then
  116. - umask $umask
  117. - /bin/chmod 700 /tmp/gztmp$$
  118. - prog="`echo $0 | /bin/sed 's|^.*/||'`"
  119. - if /bin/ln /tmp/gztmp$$ "/tmp/$prog" 2>/dev/null; then
  120. - trap '/bin/rm -f /tmp/gztmp$$ "/tmp/$prog"; exit $res' 0
  121. - (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$ "/tmp/$prog") 2>/dev/null &
  122. - /tmp/"$prog" ${1+"$@"}; res=$?
  123. - else
  124. - trap '/bin/rm -f /tmp/gztmp$$; exit $res' 0
  125. - (/bin/sleep 5; /bin/rm -f /tmp/gztmp$$) 2>/dev/null &
  126. - /tmp/gztmp$$ ${1+"$@"}; res=$?
  127. - fi
  128. +skip=14
  129. +tmpdir=`/bin/mktemp -d ${TMPDIR:-/tmp}/gzexe.XXXXXXXXXX` || exit 1
  130. +prog="${tmpdir}/`echo \"$0\" | sed 's|^.*/||'`"
  131. +if tail +$skip "$0" | "BINDIR"/gzip -cd > "$prog"; then
  132. + /bin/chmod 700 "$prog"
  133. + trap '/bin/rm -rf $tmpdir; exit $res' EXIT
  134. + "$prog" ${1+"$@"}; res=$?
  135. else
  136. - echo Cannot decompress $0; exit 1
  137. + echo "Cannot decompress $0"
  138. + /bin/rm -rf $tmpdir
  139. + exit 1
  140. fi; exit $res
  141. EOF
  142. gzip -cv9 "$i" >> $tmp || {
  143. --- gzip-1.3.5/zdiff.in.owl-tmp 2002-09-26 10:33:24.000000000 +0200
  144. +++ gzip-1.3.5/zdiff.in 2005-03-21 18:35:36.669875653 +0100
  145. @@ -46,13 +46,13 @@
  146. case "$2" in
  147. *[-.]gz* | *[-.][zZ] | *.t[ga]z)
  148. F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'`
  149. - set -C
  150. - trap 'rm -f /tmp/"$F".$$; exit 2' HUP INT PIPE TERM 0
  151. - gzip -cdfq "$2" > /tmp/"$F".$$ || exit
  152. - gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$
  153. + TF=`/bin/mktemp ${TMPDIR:-/tmp}/"$F".XXXXXXXXXX` || exit 1
  154. + trap 'rm -f "$TF"; exit 2' EXIT HUP INT PIPE TERM
  155. + gzip -cdfq "$2" > "$TF" || exit
  156. + gzip -cdfq "$1" | $comp $OPTIONS - "$TF"
  157. STAT="$?"
  158. - /bin/rm -f /tmp/"$F".$$ || STAT=2
  159. - trap - HUP INT PIPE TERM 0
  160. + rm -f "$TF" || STAT=2
  161. + trap - EXIT HUP INT PIPE TERM
  162. exit $STAT;;
  163. *) gzip -cdfq "$1" | $comp $OPTIONS - "$2";;