diff -upk.orig gzip-1.3.5.orig/znew.1 gzip-1.3.5/znew.1 --- gzip-1.3.5.orig/znew.1 1993-07-07 11:03:19 +0000 +++ gzip-1.3.5/znew.1 2005-05-20 17:40:36 +0000 @@ -15,7 +15,7 @@ to force a .Z extension then apply znew. Force recompression from .Z to .gz format even if a .gz file already exists. .TP .B \-t -Tests the new files before deleting originals. +Tests the new files before deleting originals (default behaviour). .TP .B \-v Verbose. Display the name and percentage reduction for each file compressed. diff -upk.orig gzip-1.3.5.orig/znew.in gzip-1.3.5/znew.in --- gzip-1.3.5.orig/znew.in 2005-05-20 15:06:31 +0000 +++ gzip-1.3.5/znew.in 2005-05-20 17:39:33 +0000 @@ -2,7 +2,7 @@ #!/bin/sh PATH="BINDIR:$PATH"; export PATH -check=0 +check=1 pipe=0 opt= files= @@ -53,7 +53,7 @@ done if test $# -eq 0; then echo "recompress .Z files into $ext (gzip) files" >&2 echo "Usage: ${0##*/} [-tv9KP] file.Z..." >&2 - echo " -t tests the new files before deleting originals" >&2 + echo " -t tests the new files before deleting originals (default)" >&2 echo " -v be verbose" >&2 echo " -9 use the slowest compression method (optimal compression)" >&2 echo " -K keep a .Z file when it is smaller than the $ext file" >&2 @@ -91,31 +91,24 @@ for i do res=1; continue fi else - if test $check -eq 1; then if cp -p "$n.Z" "$n.$$" 2> /dev/null || cp "$n.Z" "$n.$$"; then : else echo cannot backup "$n.Z" res=1; continue fi - fi if gzip -d "$n.Z"; then : else - test $check -eq 1 && mv "$n.$$" "$n.Z" + mv "$n.$$" "$n.Z" echo error while uncompressing $n.Z res=1; continue fi if gzip $opt "$n"; then : else - if test $check -eq 1; then mv "$n.$$" "$n.Z" && rm -f "$n" echo error while recompressing $n - else - # compress $n (might be dangerous if disk full) - echo error while recompressing $n, left uncompressed - fi res=1; continue fi fi @@ -124,14 +117,13 @@ for i do `expr \( $new + $block - 1 \) / $block`; then if test $pipe -eq 1; then rm -f "$n$ext" - elif test $check -eq 1; then - mv "$n.$$" "$n.Z" && rm -f "$n$ext" else - gzip -d "$n$ext" && compress "$n" && rm -f "$n$ext" + mv "$n.$$" "$n.Z" && rm -f "$n$ext" fi echo "$n.Z smaller than $n$ext -- unchanged" - - elif test $check -eq 1; then + elif test $pipe -eq 1; then + rm -f "$n.Z" + else if gzip -t "$n$ext" ; then rm -f "$n.$$" "$n.Z" else @@ -140,8 +132,6 @@ for i do echo error while testing $n$ext, $n.Z unchanged res=1; continue fi - elif test $pipe -eq 1; then - rm -f "$n.Z" fi done exit $res