From: Bdale Garbee Date: Fri, 13 Apr 2012 05:20:17 +0000 (-0600) Subject: Revert "patch to improve behavior of zdiff when file is compressed without extension" X-Git-Tag: debian/1.4-6 X-Git-Url: https://git.gag.com/?p=debian%2Fgzip;a=commitdiff_plain;h=4fc4e82abfb3710733ab21e5dfcb81abdedbe5a2 Revert "patch to improve behavior of zdiff when file is compressed without extension" This reverts commit b2747d0988265018e8b4db1ba44214b0e506d09a. Unfortunately, this patch breaks 'make check' ... --- diff --git a/debian/changelog b/debian/changelog index 0e27262..7d07c2c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,6 @@ gzip (1.4-6) unstable; urgency=low closes: #637626 * patch to improve zdiff doc from Stéphane Aulery, closes: #269612 * patches to fix RFC URLs from Stéphane Aulery, closes: #636182 - * patch from Stéphane Aulery to improve zdiff behavior when file is - compressed without explicit extension, closes: #343575, #630111 -- Bdale Garbee Thu, 12 Apr 2012 23:11:46 -0600 diff --git a/debian/patches/series b/debian/patches/series index f85a092..c6482a4 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,4 +7,3 @@ zgrep-dash-h.diff gzip-man-pack.diff zdiff-man.diff rfc-urls.diff -zdiff-file.diff diff --git a/debian/patches/zdiff-file.diff b/debian/patches/zdiff-file.diff deleted file mode 100644 index ea7bc6d..0000000 --- a/debian/patches/zdiff-file.diff +++ /dev/null @@ -1,61 +0,0 @@ -diff --git a/zdiff.in b/zdiff.in -index 9d3b4ae..506a888 100644 ---- a/zdiff.in -+++ b/zdiff.in -@@ -76,9 +76,15 @@ gzip_status=0 - exec 3>&1 - - if test $# -eq 1; then -- case $1 in -- *[-.]gz* | *[-.][zZ] | *.t[ga]z) -+ type_file=$(file -b --mime-type "$1") -+ -+ case $type_file in -+ application/x-gzip | application/x-compress) - FILE=`expr "X$1" : 'X\(.*\)[-.][zZtga]*$'` -+ if test "$FILE" == ""; then -+ FILE="$1" -+ fi; -+ - gzip_status=$( - exec 4>&1 - (gzip -cd -- "$1" 4>&-; echo $? >&4) 3>&- | eval "$cmp" - '"$FILE"' >&3 -@@ -88,10 +94,13 @@ if test $# -eq 1; then - exit 2;; - esac - elif test $# -eq 2; then -- case "$1" in -- *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) -- case "$2" in -- *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) -+ type_file1=$(file -b --mime-type "$1") -+ type_file2=$(file -b --mime-type "$2") -+ -+ case "$type_file1" in -+ application/x-gzip | application/x-compress) -+ case "$type_file2" in -+ application/x-gzip | application/x-compress) - if test "$1$2" = --; then - gzip_status=$( - exec 4>&1 -@@ -118,6 +127,9 @@ elif test $# -eq 2; then - (exit $cmp_status) - else - F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog -+ if test "$F" == ""; then -+ F="$2" -+ fi; - tmp= - trap ' - test -n "$tmp" && rm -f "$tmp" -@@ -147,8 +159,8 @@ elif test $# -eq 2; then - eval "$cmp" - '"$2"' >&3 - );; - esac;; -- *) case "$2" in -- *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) -+ *) case "$type_file2" in -+ application/x-gzip | application/x-compress) - gzip_status=$( - exec 4>&1 - (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- | diff --git a/zdiff.in b/zdiff.in index 506a888..9d3b4ae 100644 --- a/zdiff.in +++ b/zdiff.in @@ -76,15 +76,9 @@ gzip_status=0 exec 3>&1 if test $# -eq 1; then - type_file=$(file -b --mime-type "$1") - - case $type_file in - application/x-gzip | application/x-compress) + case $1 in + *[-.]gz* | *[-.][zZ] | *.t[ga]z) FILE=`expr "X$1" : 'X\(.*\)[-.][zZtga]*$'` - if test "$FILE" == ""; then - FILE="$1" - fi; - gzip_status=$( exec 4>&1 (gzip -cd -- "$1" 4>&-; echo $? >&4) 3>&- | eval "$cmp" - '"$FILE"' >&3 @@ -94,13 +88,10 @@ if test $# -eq 1; then exit 2;; esac elif test $# -eq 2; then - type_file1=$(file -b --mime-type "$1") - type_file2=$(file -b --mime-type "$2") - - case "$type_file1" in - application/x-gzip | application/x-compress) - case "$type_file2" in - application/x-gzip | application/x-compress) + case "$1" in + *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) + case "$2" in + *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) if test "$1$2" = --; then gzip_status=$( exec 4>&1 @@ -127,9 +118,6 @@ elif test $# -eq 2; then (exit $cmp_status) else F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog - if test "$F" == ""; then - F="$2" - fi; tmp= trap ' test -n "$tmp" && rm -f "$tmp" @@ -159,8 +147,8 @@ elif test $# -eq 2; then eval "$cmp" - '"$2"' >&3 );; esac;; - *) case "$type_file2" in - application/x-gzip | application/x-compress) + *) case "$2" in + *[-.]gz* | *[-.][zZ] | *.t[ga]z | -) gzip_status=$( exec 4>&1 (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |