freshen changelog timestamp in preparation for upload
[debian/gzip] / debian / patches / zdiff-file.diff
1 diff --git a/zdiff.in b/zdiff.in
2 index 9d3b4ae..506a888 100644
3 --- a/zdiff.in
4 +++ b/zdiff.in
5 @@ -76,9 +76,15 @@ gzip_status=0
6  exec 3>&1
7  
8  if test $# -eq 1; then
9 -  case $1 in
10 -  *[-.]gz* | *[-.][zZ] | *.t[ga]z)
11 +  type_file=$(file -b --mime-type "$1")
12 +
13 +  case $type_file in
14 +  application/x-gzip | application/x-compress)
15      FILE=`expr "X$1" : 'X\(.*\)[-.][zZtga]*$'`
16 +    if test "$FILE" == ""; then
17 +        FILE="$1"
18 +    fi;
19 +    
20      gzip_status=$(
21        exec 4>&1
22        (gzip -cd -- "$1" 4>&-; echo $? >&4) 3>&- | eval "$cmp" - '"$FILE"' >&3
23 @@ -88,10 +94,13 @@ if test $# -eq 1; then
24      exit 2;;
25    esac
26  elif test $# -eq 2; then
27 -       case "$1" in
28 -       *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
29 -                case "$2" in
30 -               *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
31 +       type_file1=$(file -b --mime-type "$1")
32 +       type_file2=$(file -b --mime-type "$2")
33 +       
34 +       case "$type_file1" in
35 +       application/x-gzip | application/x-compress)
36 +                case "$type_file2" in
37 +               application/x-gzip | application/x-compress)
38                     if test "$1$2" = --; then
39                         gzip_status=$(
40                           exec 4>&1
41 @@ -118,6 +127,9 @@ elif test $# -eq 2; then
42                         (exit $cmp_status)
43                     else
44                         F=`expr "/$2" : '.*/\(.*\)[-.][zZtga]*$'` || F=$prog
45 +                       if test "$F" == ""; then
46 +                           F="$2"
47 +                       fi;
48                         tmp=
49                         trap '
50                           test -n "$tmp" && rm -f "$tmp"
51 @@ -147,8 +159,8 @@ elif test $# -eq 2; then
52                         eval "$cmp" - '"$2"' >&3
53                     );;
54                  esac;;
55 -        *)      case "$2" in
56 -               *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
57 +        *)      case "$type_file2" in
58 +               application/x-gzip | application/x-compress)
59                         gzip_status=$(
60                           exec 4>&1
61                           (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- |