[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#215588: xdvi does not honor XAPPLRESDIR



Package: tetex-bin
Version: 2.0.2-4.3
Tags: patch

The xdvi program fails to honor my XAPPLRESDIR envvar.  This is because
the wrapper script /usr/bin/xdvi co-opts it for its own use.  I want my
XAPPLRESDIR to work.  XAPPLRESDIR is for user customizations, and
applications should not be setting it themselves.

Looking at the script, I see that it claims that clobbering XAPPLRESDIR
provides X11R3 compatibility.  A laudable goal, except that it also
breaks R4, R5, and R6.  The teTeX author has a choice to make whether it
is more important to support R3 or newer X11 releases.  However, Debian
includes X11R6, so Debian xdvi should support R6.  The included patch
fixes this compatibility.

As long as we are fixing the X environment variables, my patch also
adds %D to the case where XFILESEARCHPATH is unset.  This probably
doesn't matter (probably only xdvi will be run in the environment being
created), but it is technically correct.  %D substitutes the
implementation's default value and is an R6 feature.


--- texk/xdvik/xdvi-pl	2003-08-31 22:53:03.000000000 -0400
+++ xdvi-pl	2003-10-09 05:24:58.000000000 -0400
@@ -23,8 +23,12 @@
 # consistency.  This has been rewritten in Perl so that we can mangle
 # the arguments to handled gzipped dvi files, which not have errors if
 # there are spaces in some arguments.
 
+# Stephen Gildea writes:
+# Debian distributes X11R6, therefore this script should not clobber
+# XAPPLRESDIR, which is for user customizations.
+
 use strict;
 use FileHandle;
 use File::Basename;
 use File::Spec;
@@ -44,17 +48,12 @@
 if ("$xdviappfile" ne '') {
     $xdviappdir=dirname($xdviappfile);
     $xdviapppath="$xdviappdir/%N";
 
-    # For R3, we have to set XAPPLRESDIR.
-    $ENV{'XAPPLRESDIR'}=$xdviappdir;
-
-    # For R4 or later, we have to set XFILESEARCHPATH, since XAPPLRESDIR might
-    # be ignored (if XUSERFILESEARCHPATH is set)
     if (exists $ENV{'XFILESEARCHPATH'}) {
 	$ENV{'XFILESEARCHPATH'} = "$xdviapppath:$ENV{'XFILESEARCHPATH'}";
     } else {
-	$ENV{'XFILESEARCHPATH'} = $xdviapppath;
+	$ENV{'XFILESEARCHPATH'} = "$xdviapppath:%D";
     }
 }
 
 my $status;



Reply to: