Package: xpdf
Version: 3.02-14
Followup-For: Bug #631109

This version of xpdf fails to have the following desirable property:
For every name $file, if $file exists then "xpdf $file" opens $file.
For example, if both $file and $file.gz exist then "xpdf $file"
currently opens $file.gz instead.  Below is a patch that restores this
property.

(ps. migration to this new version may also be eased if zxpdf were a
symlink to xpdf.)

Thanks,
        Ken

--- /tmp/xpdf.orig      2011-06-20 23:02:37.000000000 +0200
+++ /usr/bin/xpdf       2011-06-20 23:02:06.000000000 +0200
@@ -40,15 +40,6 @@
         done
         break ;;
     -*) cmd="$cmd $1" ;;
-    *.[pP][Dd][Ff])
-        test "$title" != "" || title="Xpdf: $1"
-        test -f "$1"     && cat="cat"   && file="$1"     || true
-        test -f "$1.Z"   && cat="zcat"  && file="$1.Z"   || true
-        test -f "$1.gz"  && cat="zcat"  && file="$1.gz"  || true
-        test -f "$1.bz2" && cat="bzcat" && file="$1.bz2" || true
-        test -f "$1.xz"  && cat="xzcat" && file="$1.xz"  || true
-        test "$cat" = "" && (echo >&2 "Error: file not found: '$1'" && false)
-        shift && pages="$@" && break ;;
     *.gz|*.Z)
         test -f "$1" && cat="zcat" && title="Xpdf: $1" && file="$1" && shift 
&& pages="$@" && break ||
             (echo >&2 "Error: file not found: '$1'" && false) ;;
@@ -59,7 +50,15 @@
         test -f "$1" && cat="xzcat" && title="Xpdf: $1" && file="$1" && shift 
&& pages="$@" && break ||
             (echo >&2 "Error: file not found: '$1'" && false) ;;
     *)
-        echo >&2 "ERROR: unknown suffix in file: '$1'" && false ;;
+        test "$title" != "" || title="Xpdf: $1"
+        if   test -f "$1"    ; then cat="cat"  ; file="$1"
+        elif test -f "$1.Z"  ; then cat="zcat" ; file="$1.Z"
+        elif test -f "$1.gz" ; then cat="zcat" ; file="$1.gz"
+        elif test -f "$1.bz2"; then cat="bzcat"; file="$1.bz2"
+        elif test -f "$1.xz" ; then cat="xzcat"; file="$1.xz"
+        else echo >&2 "Error: file not found: '$1'"; false
+        fi
+        shift && pages="$@" && break ;;
     esac
     shift
 done

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.39 (SMP w/4 CPU cores)
Locale: LANG=zh_TW.UTF-8, LC_CTYPE=zh_TW.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xpdf depends on:
ii  lesstif2                      1:0.95.2-1 OSF/Motif 2.1 implementation relea
ii  libc6                         2.13-7     Embedded GNU C Library: Shared lib
ii  libgcc1                       1:4.6.0-14 GCC support library
ii  libpoppler5                   0.12.4-1.2 PDF rendering library
ii  libstdc++6                    4.6.0-14   GNU Standard C++ Library v3
ii  libx11-6                      2:1.4.3-2  X11 client-side library
ii  libxt6                        1:1.1.1-2  X11 toolkit intrinsics library

Versions of packages xpdf recommends:
ii  gsfonts-x11                   0.22       Make Ghostscript fonts available t
ii  poppler-data                  0.4.4-1    Encoding data for the poppler PDF 
ii  poppler-utils                 0.12.4-1.2 PDF utilitites (based on libpopple

xpdf suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/bin/xpdf (from xpdf package)

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
Kosketa minua, Henki,
kosketa, kirkkaus!
Anna elämälle
suunta ja tarkoitus.

Attachment: signature.asc
Description: Digital signature

Reply via email to