File source.dif of Package texlive

--- Makefile.in
+++ Makefile.in	2007-03-06 18:59:46.000000000 +0100
@@ -68,26 +68,26 @@ install: all 
 	- if test -f texk/web2c/omegafonts/omfonts; then \
 	    cd texk/web2c/omegafonts && $(MAKE) install-links; \
 	else :; fi
-	$(srcdir)/selfautofix "$(bindir)" "$(texmf)/web2c"
-	- if test -f $(scriptdir)/mktexlsr; then \
-	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-	    $(scriptdir)/mktexlsr; \
-	else :; fi
-	- if test -f $(scriptdir)/fmtutil-sys; then \
-	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-	    $(scriptdir)/fmtutil-sys --all; \
-	else :; fi
-	- if test -f $(scriptdir)/texlinks; then \
-	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-	    $(scriptdir)/texlinks; \
-	else :; fi
-	- if test -f $(scriptdir)/updmap-sys \
-	  && TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-	       $(scriptdir)/kpsewhich --format='web2c files' updmap.cfg >/dev/null; \
-	then \
-	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
-	    $(scriptdir)/updmap-sys; \
-	else :; fi
+@FMU@	$(srcdir)/selfautofix "$(bindir)" "$(texmf)/web2c"
+@FMU@	- if test -f $(scriptdir)/mktexlsr; then \
+@FMU@	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
+@FMU@	    $(scriptdir)/mktexlsr; \
+@FMU@	else :; fi
+@FMU@	- if test -f $(scriptdir)/fmtutil-sys; then \
+@FMU@	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
+@FMU@	    $(scriptdir)/fmtutil-sys --all; \
+@FMU@	else :; fi
+@FMU@	- if test -f $(scriptdir)/texlinks; then \
+@FMU@	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
+@FMU@	    $(scriptdir)/texlinks; \
+@FMU@	else :; fi
+@FMU@	- if test -f $(scriptdir)/updmap-sys \
+@FMU@	  && TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
+@FMU@	       $(scriptdir)/kpsewhich --format='web2c files' updmap.cfg >/dev/null; \
+@FMU@	then \
+@FMU@	  TEXMFMAIN=$(texmf) PATH=$(scriptdir):$(bindir):$(PATH) \
+@FMU@	    $(scriptdir)/updmap-sys; \
+@FMU@	else :; fi
 
 install-exec:
 	for dir in $(INSTDIRS); do \
--- texk/Makefile.in
+++ texk/Makefile.in	2007-04-27 09:31:00.000000000 +0000
@@ -13,7 +13,8 @@
 # It's too bad we have to pass all these down, but I see no alternative,
 # if we are to propagate changes at the top level.
 # XMAKEARGS is for the user to override.
-makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(makevars) $(XMAKEARGS)
+makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' CXXFLAGS='$(CXXFLAGS)' LDFLAGS='$(LDFLAGS)' $(makevars) $(XMAKEARGS)
+makepie = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS) $(XCPIE)' CXXFLAGS='$(CXXFLAGS) $(XCPIE)' LDFLAGS='$(LDFLAGS) $(XLPIE)' $(makevars) $(XMAKEARGS)
 installargs = INSTALL_DATA='$(INSTALL_DATA)' \
   INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(makeargs)
 
@@ -33,7 +34,7 @@
 # no good reason with the latter.
 default all: do-kpathsea
 	for d in $(programs); do if test -f $$d/Makefile; then \
-	  (cd $$d && $(MAKE) $(makeargs) $@) || exit 1; else true; fi; done
+	  (cd $$d && $(MAKE) $(makepie) $@) || exit 1; else true; fi; done
 
 install install-data install-exec:
 	for d in kpathsea $(programs); do if test -f $$d/Makefile; then \
@@ -51,7 +52,7 @@
 
 distclean::
 	for d in $(all_dirs); do if test -f $$d/Makefile; then \
-	  (cd $$d && $(MAKE) $(makeargs) $@) || exit 1; else true; fi; done
+	  (cd $$d && $(MAKE) $(makepie) $@) || exit 1; else true; fi; done
 
 distclean realclean::
 	rm -f Makefile Makefile.aux config.status config.cache config.log libtool kpse_empty
@@ -66,7 +67,7 @@
 formats fmts bases mems \
 install-formats install-fmts install-bases install-mems \
 install-links c-sources: do-kpathsea
-	cd web2c && $(MAKE) $(makeargs) $@
+	cd web2c && $(MAKE) $(makepie) $@
 
 @MAINT@ac_dir = $(srcdir)/etc/autoconf
 @MAINT@autoconf = $(ac_dir)/acspecific.m4 $(ac_dir)/acgeneral.m4 $(ac_dir)/acsite.m4
--- texk/dviljk/dvi2xx.c
+++ texk/dviljk/dvi2xx.c	2006-08-16 13:29:16.000000000 +0200
@@ -175,7 +175,18 @@ char    *argv[];
   setbuf(ERR_STREAM, NULL);
   (void) strcpy(G_progname, argv[0]);
 #ifdef KPATHSEA
-  kpse_set_progname(argv[0]);
+#if defined(LJ)
+  kpse_set_program_name (argv[0], "dvilj");
+#endif
+#if defined(LJ2P)
+  kpse_set_program_name (argv[0], "dvilj2p");
+#endif
+#if defined(LJ4) && !defined(LJ4L)
+  kpse_set_program_name (argv[0], "dvilj4");
+#endif
+#if defined(LJ4) && defined(LJ4L)
+  kpse_set_program_name (argv[0], "dvilj4l");
+#endif
   kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
 #endif
   DecodeArgs(argc, argv);
--- texk/kpathsea/Makefile.in
+++ texk/kpathsea/Makefile.in	2006-08-16 13:29:16.000000000 +0200
@@ -130,6 +130,7 @@ stamp-paths: texmf.cnf
 	| sed -e 's%\$$TEXMFMAIN%$(texmf)%g' \
 	      -e 's%\$$TEXMF%$(texmf)%g' \
 	      -e 's%\$$VARTEXFONTS%$(vartexfonts)%g' \
+	      -e 's%\$$TEXMFVAR%$(texmfvar)%g' \
 	      -e 's%\$$web2cdir%$(web2cdir)%g' \
 	      -e 's%\$$prefix%$(prefix)%g' \
 	| sed -e 's%;%:%g' \
--- texk/kpathsea/c-fopen.h
+++ texk/kpathsea/c-fopen.h	2006-08-16 13:29:16.000000000 +0200
@@ -37,17 +37,17 @@
 
 /* How to open a binary file for reading:  */
 #ifndef FOPEN_RBIN_MODE
-#define	FOPEN_RBIN_MODE	"rb"
+#define FOPEN_RBIN_MODE	"r"
 #endif /* not FOPEN_RBIN_MODE */
 
 /* How to open a binary file for writing:  */
 #ifndef FOPEN_WBIN_MODE
-#define FOPEN_WBIN_MODE "wb"
+#define FOPEN_WBIN_MODE	"w"
 #endif /* not FOPEN_WBIN_MODE */
 
 /* How to open a binary file for appending:  */
 #ifndef FOPEN_ABIN_MODE
-#define FOPEN_ABIN_MODE "ab"
+#define FOPEN_ABIN_MODE "a"
 #endif /* not FOPEN_ABIN_MODE */
 
 /* How to switch an already open file handle to binary mode.
--- texk/kpathsea/c-memstr.h
+++ texk/kpathsea/c-memstr.h	2006-08-16 13:29:16.000000000 +0200
@@ -41,6 +41,7 @@
 
 /* Just to be complete, we make both the system V/ANSI and the BSD
    versions of the string functions available.  */
+#ifndef __GNUC__
 #if !defined(HAVE_STRCHR) && !defined(strchr)
 #define strchr index
 #endif
@@ -85,4 +86,6 @@ extern char *strstr ();
 #endif
 #endif
 
+#endif /* not __GNUC__ */
+
 #endif /* not KPATHSEA_C_MEMSTR_H */
--- texk/kpathsea/db.c
+++ texk/kpathsea/db.c	2006-08-16 13:29:16.000000000 +0200
@@ -92,12 +92,21 @@ db_build P2C(hash_table_type *, table,  
   unsigned len = strlen (db_filename) - sizeof (DB_NAME) + 1; /* Keep the /. */
   string top_dir = (string)xmalloc (len + 1);
   string cur_dir = NULL; /* First thing in ls-R might be a filename.  */
-  FILE *db_file = fopen (db_filename, FOPEN_R_MODE);
+  struct stat statdb;
+  FILE *db_file;
   
   strncpy (top_dir, db_filename, len);
   top_dir[len] = 0;
-  
-  if (db_file) {
+
+  if ((getenv("MKTEXLSR") == NULL) &&
+      (stat(db_filename, &statdb) < 0 || statdb.st_size == 0)) {
+    char buf[PATH_MAX+1];
+    snprintf(buf, PATH_MAX, "mktexlsr %s", top_dir);
+    xputenv("MKTEXLSR", "true"); /* fork loop detection */
+    system (buf);
+  }
+
+  if ((db_file = fopen (db_filename, FOPEN_R_MODE))) {
     while ((line = read_line (db_file)) != NULL) {
       len = strlen (line);
 
--- texk/kpathsea/mktex.opt
+++ texk/kpathsea/mktex.opt	2008-03-25 18:43:47.745804163 +0100
@@ -37,10 +37,11 @@ if test "$DOSISH" = "no"; then SEP=':'; 
 # TEMPDIR needs to be unique to each process because of the possibility of two
 # people running dvips (or whatever) simultaneously.
 if test -n "$TMPDIR"; then
-  TEMPDIR="${TMPDIR}/mt$$.tmp"
+  TEMPDIR="${TMPDIR}/.mtXXXXXXXXXX"
 else
-  TEMPDIR="/tmp/mt$$.tmp"
+  TEMPDIR="/tmp/.mtXXXXXXXXXX"
 fi
+TEMPDIR=$(mktemp -d "$TEMPDIR") || exit 1
 
 # We want to output only filenames to standard output, but it's too
 # error-prone to write the scripts that way, so we direct stdout here.
@@ -48,17 +49,23 @@ STDOUT="$TEMPDIR/mt$$.out"
 
 # We will change search paths to include $KPSE_DOT. This is necessary
 # since we cd to $TEMPDIR.
-: ${KPSE_DOT=`pwd`}; export KPSE_DOT
+: ${KPSE_DOT=${PWD}}; export KPSE_DOT
 
 # Clean up on normal or abnormal exit.
 # The "cd /" is for MS-DOS and MS-Windows, where there is a separate
 # current directory on each drive, and therefore "cd $KPSE_DOT" might
 # still leave $TMPDIR current directory on its drive, in which case it
 # cannot be removed.
-trap 'rc=$?; cd /; cd "$KPSE_DOT"; test -f "$STDOUT" && cat "$STDOUT"; rm -rf "$TEMPDIR"; exit $rc' \
-  0 1 2 3 7 13 15
+atexit ()
+{
+  local rc=$?
+  cd "$KPSE_DOT"
+  test -n "$STDOUT"  -a -f "$STDOUT"  && cat "$STDOUT"
+  test -n "$TEMPDIR" -a -d "$TEMPDIR" && rm -rf "$TEMPDIR"
+  exit $rc
+}
+trap 'atexit' EXIT SIGHUP SIGINT SIGQUIT SIGBUS SIGPIPE SIGTERM
 
-(umask 077 && mkdir "$TEMPDIR") || exit 1
 cd "$TEMPDIR" || exit 1
 
 # The alternative location for fonts.  The directory need not exist,
@@ -68,6 +75,11 @@ if test -z "$MT_VARTEXFONTS"; then
   echo "$0: VARTEXFONTS is not defined.  Defaulting to \`$KPSE_DOT'." >&2
   MT_VARTEXFONTS='$KPSE_DOT'
 fi
+: ${MT_TEXMFVAR=`kpsewhich --expand-var='$TEXMFVAR' | sed 's%^!!%%'`}
+if test -z "$MT_TEXMFVAR"; then
+  echo "$0: TEXMFVAR is not defined.  Defaulting to \`$KPSE_DOT'." >&2
+  MT_TEXMFVAR='$KPSE_DOT'
+fi
 
 # The supporting scripts:
 : ${MT_MKTEXNAM=`kpsewhich --format='web2c files' mktexnam`}
--- texk/kpathsea/mktexlsr
+++ texk/kpathsea/mktexlsr	2008-02-15 11:39:09.784316068 +0100
@@ -15,6 +15,10 @@
 
 version='$Id: mktexlsr,v 1.46 2005/06/21 14:32:26 olaf Exp $'
 progname=`echo $0 | sed 's%.*/%%'`
+
+MKTEXLSR=true; export MKTEXLSR
+set -o noclobber
+
 usage="Usage: $progname [DIR]...
 
 Only options are --help, --version, and --verbose.  If standard input is
@@ -40,6 +44,9 @@ if test "$DOSISH" = "no"; then SEP=':'; 
 # be done before kpsewhich can be called, and thus cannot be put into
 # mktex.opt.
 dirname=`echo $0 | sed 's%/*[^/][^/]*$%%'`
+case "$SEP$PATH$SEP" in
+   *$SEP$dirname$SEP*)  dirname="" ;;
+esac
 case $dirname in
   "") # Do nothing
       ;;
@@ -51,6 +58,28 @@ case $dirname in
       export PATH ;;
 esac
 
+# Sometimes the scripts and binaries are located elsewhere check this
+# by following the links and extend the path with appropiate dirnames.
+   link=`readlink -f $0`
+dirname=`echo $link | sed 's%/*[^/][^/]*$%%'`
+    cpu=`uname -i|tr '[:upper:]' '[:lower:]' | sed 's/ppc64/ppc/;s/i386/i?86/'`
+     os=`uname -s|tr '[:upper:]' '[:lower:]'`
+ binary=`echo $dirname | sed "s%share%lib%;s%noarch%${cpu}-${os}%"`
+ binary=`echo $binary`
+case "$SEP$PATH$SEP" in
+   *$SEP$dirname$SEP*)  dirname="" ;;
+esac
+case $dirname in
+  "") # Do nothing
+       ;;
+  /* | [A-z]:/*) # Absolute name
+      PATH="$dirname$SEP$binary$SEP$PATH"
+      export PATH ;;
+   *)  # Relative name
+      PATH="`pwd`/$dirname$SEP`pwd`/$binary$SEP$PATH"
+      export PATH ;;
+esac
+
 if tty -s; then verbose=true; else verbose=false; fi
 
 # A copy of some stuff from mktex.opt, so we can run in the presence of
@@ -85,6 +114,21 @@ test $# = 0 && {
   IFS=$OIFS
 }
 
+nobody="$(id -un nobody)"
+if test "$(id -ur 2> /dev/null)" = "0" -a -n "$nobody" ; then
+    grep -qE 'nobody:[^:]*:[0-9]+:0:0::::' /etc/shadow
+    if test $? -eq 0 ; then
+	echo "$progname: Warning the password of the user nobody has expired." >&2
+	echo "          Please use program \`chage' to set maxdays to 99999." >&2
+	echo ""
+	exit 1
+    fi
+    runls () { su $nobody -s /bin/sh -c 'exec -a ls ls -LRa 2>/dev/null'; }
+else
+    runls () { ls -LRa 2>/dev/null; }
+fi
+
+cache="`kpsewhich --expand-var='$VARTEXFONTS'`"
 for TEXMFLS_R in "$@"; do
   # Prepend cwd if the directory was relative.
   case "$TEXMFLS_R" in
@@ -112,12 +156,23 @@ for TEXMFLS_R in "$@"; do
   db_dir=`echo "$db_file" | sed 's%/[^/][^/]*$%%'` # can't rely on dirname
 
   test -d "$db_dir" || continue
-  test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; }
+  if test -w "$db_dir" ; then
+    # default
+    db_dir_tmp="$db_dir/.lsR.XXXXXX"
+  else
+    # Escape to writable cache directory
+    test -w "$cache" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; }
+    db_dir_tmp="$cache/.lsR.XXXXXX"
+  fi
 
   if test ! -f "$db_file"; then
-    cp /dev/null "$db_file"
+    # Note: this script has set the noclobber option at line 20
+    > "$db_file" \
+	|| { echo "$progname: could not create file '$db_file'. Skipping..." >&2; continue; }
     # Use same permissions as parent directory, minus x,s, or t bits.
     chmod `kpsestat -xst "$db_dir"` "$db_file"
+  elif test -w $db_file -a ! -s $db_file ; then
+    :  Is writable but empty
   elif test -s "$db_file" \
        && test "x`sed '1s/$//;1q' \"$db_file\"`" != "x$ls_R_magic" \
        && test "x`sed '1s/$//;1q' \"$db_file\"`" != "x$old_ls_R_magic"; then
@@ -128,14 +183,21 @@ for TEXMFLS_R in "$@"; do
   # Skip if we cannot write the file:
   kpseaccess -w "$db_file" || { echo "$progname: $db_file: no write permission. Skipping..." >&2; continue; }
 
-  db_dir_tmp="$db_dir/lsR$$.tmp"
-  (umask 077 && mkdir "$db_dir_tmp" ) \
+  until PERMS=`kpsestat = "$db_file"`; do sleep 1; done
+  if test "$PERMS" = "666" -a ! -k "$db_dir" ; then
+    echo "$progname: '$db_file' world writable but '$db_dir' not sticky. Skipping..." >&2;
+    continue;
+  fi
+
+  db_dir_tmp=$(mktemp -d "$db_dir_tmp") \
     || { echo "$progname: could not create directory '$db_dir_tmp'. Skipping..." >&2; continue; }
   db_file_tmp="$db_dir_tmp/lsR$$.tmp"
   rm -f "$db_file_tmp"
 
   $verbose && echo "$progname: Updating $db_file... " >&2
-  echo "$ls_R_magic" >"$db_file_tmp"
+  # Note: this script has set the noclobber option at line 20
+  echo "$ls_R_magic" >"$db_file_tmp" \
+    || { echo "$progname: could not create file '$db_file_tmp'. Skipping..." >&2; continue; }
 
   # The main task. We put ./: in the output, so top-level files can be
   # found via ls-R. Probably irrelevant in practice.
@@ -146,7 +208,7 @@ for TEXMFLS_R in "$@"; do
   # We do not try to support colons in directory names.
   # 
   echo "./:" >>"$db_file_tmp"
-  (cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) \
+  (cd "$TEXMFLS_R" && \runls) \
    | sed -e '/^$/{n;s%^\./%%;s%^%./%;}; /^\.$/d; /^\.\.$/d; /^\.svn$/d;' \
         -e '/^[\.\/]*lsR[0-9]*\.tmp:*$/d' \
    | sed -e '/\.svn.*:$/,/^$/d' \
@@ -155,8 +217,16 @@ for TEXMFLS_R in "$@"; do
   # To be really safe, a loop.
   until PERMS=`kpsestat = "$db_file"`; do sleep 1; done
   chmod $PERMS "$db_file_tmp"
-  rm -f "$db_file"
-  mv "$db_file_tmp" "$db_file"
+  if test -O "$db_file" ; then
+    # We're the owner of the $db_file
+    mv "$db_file_tmp" "$db_file"
+  else
+    # Sticky bit is set see line 141
+    # Temporary unset the noclobber option at line 20
+    set +o noclobber
+    cat "$db_file_tmp" > "$db_file"
+    set -o noclobber
+  fi
   rm -rf "$db_dir_tmp"
 done
 $verbose && echo "$progname: Done." >&2
--- texk/kpathsea/texmf.in
+++ texk/kpathsea/texmf.in	2008-03-04 17:07:13.000000000 +0000
@@ -56,15 +56,15 @@
 
 % The tree containing the runtime files closely related to the specific
 % program version used:
-TEXMFMAIN = @texmf@
+TEXMFMAIN = /usr/lib/texmf
 
 % The main distribution tree:
-TEXMFDIST = @texmf@-dist
+TEXMFDIST = @texmf@
 
 % A place for local additions to a "standard" texmf tree.
 % This tree is not used for local configuration maintained by
 % texconfig, it uses TEXMFCONFIG below.
-TEXMFLOCAL = @texmf@-local
+TEXMFLOCAL = /usr/local/share/texmf
 
 % TEXMFSYSVAR, where texconfig-sys stores variable runtime data.
 % With teTeX-3.0 or later, this must be set.
@@ -72,7 +72,7 @@ TEXMFLOCAL = @texmf@-local
 %   TEXMFSYSVAR = $TEXMFMAIN
 % For using a separate tree:
 %   TEXMFSYSVAR = @texmf@-var
-TEXMFSYSVAR = @texmf@-var
+TEXMFSYSVAR = @texmfvar@
 
 % TEXMFSYSCONFIG, where texconfig-sys stores configuration data.
 % With teTeX-3.0 or later, this must be set.
@@ -80,10 +80,10 @@ TEXMFSYSVAR = @texmf@-var
 %   TEXMFSYSCONFIG = $TEXMFMAIN
 % For using a separate tree:
 %   TEXMFSYSCONFIG = @texmf@-config
-TEXMFSYSCONFIG = @texmf@-config
+TEXMFSYSCONFIG = @texmfconf@
 
 % User texmf trees are allowed as follows.
-% This used to be HOMETEXMF.
+% This used to be TEXMFHOME.
 TEXMFHOME = $HOME/texmf
 
 % TEXMFVAR, where texconfig stores variable runtime data.
@@ -92,7 +92,7 @@ TEXMFHOME = $HOME/texmf
 %   TEXMFVAR = $TEXMFMAIN
 % For using a separate tree:
 %   TEXMFVAR = $HOME/.texmf-var  # teTeX 3.0 default
-TEXMFVAR = $HOME/.texmf-var
+TEXMFVAR = ${TEXMFSYSVAR}
 
 % TEXMFCONFIG, where texconfig stores configuration data.
 % With teTeX-3.0 or later, this must be set.
@@ -102,7 +102,7 @@ TEXMFVAR = $HOME/.texmf-var
 %   TEXMFCONFIG = $HOME/.texmf-config  # teTeX 3.0 default
 % For using a separate tree:
 %   TEXMFCONFIG = @texmf@-config
-TEXMFCONFIG = $HOME/.texmf-config
+TEXMFCONFIG = ${TEXMFSYSCONFIG}
 
 % Now, list all the texmf trees. If you have multiple trees you can
 % use shell brace notation, like this:
@@ -111,13 +111,13 @@ TEXMFCONFIG = $HOME/.texmf-config
 %
 % For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named
 % explicitly and before all other trees.
-TEXMF = {$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
+TEXMF = {$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST}
 
 % The system trees.  These are the trees that are shared by all the users.
 % If a tree appears in this list, the mktex* scripts will use
 % VARTEXFONTS for generated files, if the original tree isn't writable;
 % otherwise the current working directory is used.
-SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
+SYSTEXMF = $TEXMFSYSCONFIG;$TEXMFSYSVAR;$TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST
 
 % Where generated fonts may be written.  This tree is used when the sources
 % were found in a system tree and either that tree wasn't writable, or the
@@ -157,7 +157,7 @@ TEXMFDBS = $TEXMF;$VARTEXFONTS
 
 % WEB2C is for Web2C specific files.  The current directory may not be
 % a good place to look for them.
-WEB2C = $TEXMF/web2c
+WEB2C = ${TEXMFHOME}/web2c;${TEXMFSYSCONFIG}/web2c;${TEXMFSYSVAR}/web2c;$TEXMF/web2c
 
 % TEXINPUTS is for TeX input files -- i.e., anything to be found by \input
 % or \openin, including .sty, .eps, etc.
@@ -238,6 +238,10 @@ TEXINPUTS.lollipop      = .;$TEXMF/tex/{
 TEXINPUTS.platex-pl     = .;$TEXMF/tex/{platex,latex,generic,}//
 TEXINPUTS.pdfplatex     = .;$TEXMF/tex/{platex,latex,generic,}//
 
+% For xmltex and pdfxmltex
+TEXINPUTS.xmltex = .;$TEXMF/tex/{xmltex,latex,generic,}//
+TEXINPUTS.pdfxmltex = .;$TEXMF/{pdftex,tex}/{xmltex,latex,generic,}//
+
 % Earlier entries override later ones, so put this last.
 TEXINPUTS               = .;$TEXMF/tex/{$progname,generic,}//
 
@@ -248,12 +252,12 @@ MPINPUTS = .;$TEXMF/metapost//
 % Dump files (fmt/base/mem) for vir{tex,mf,mp} to read (see web2c/INSTALL),
 % and string pools (.pool) for ini{tex,mf,mp}.  It is silly that we have
 % separate variables for the different programs here, but historically ...
-TEXFORMATS = .;$TEXMF/web2c/{$engine,}//
-MFBASES = .;$TEXMF/web2c/{$engine,}//
-MPMEMS = .;$TEXMF/web2c/{$engine,}//
-TEXPOOL = .;$TEXMF/web2c
-MFPOOL = .;$TEXMF/web2c
-MPPOOL = .;$TEXMF/web2c
+TEXFORMATS = .;$WEB2C/{$engine,}//
+MFBASES = .;$WEB2C/{$engine,}//
+MPMEMS = .;$WEB2C/{$engine,}//
+TEXPOOL = .;$WEB2C
+MFPOOL = .;$WEB2C
+MPPOOL = .;$WEB2C
 
 % support the original xdvi.  Must come before the generic settings.
 PKFONTS.XDvi   = .;$TEXMF/%s;$VARTEXFONTS/pk/{%m,modeless}//
@@ -279,7 +283,7 @@ GFFONTS = .;$TEXMF/fonts/gf/$MAKETEX_MOD
 GLYPHFONTS = .;$TEXMF/fonts
 
 % A place to puth everything that doesn't fit the other font categories.
-MISCFONTS = .;$TEXMF/fonts/misc//
+MISCFONTS = .;$TEXMF/fonts/misc//;$TEXMF/fonts/hbf//
 
 % font name map files.
 TEXFONTMAPS = .;$TEXMF/fonts/map/{$progname,pdftex,dvips,}//
@@ -339,12 +343,15 @@ MPSUPPORT = .;$TEXMF/metapost/support
 % For xdvi to find mime.types and .mailcap, if they do not exist in
 % $HOME.  These are single directories, not paths.
 % (But the default mime.types, at least, may well suffice.)
-MIMELIBDIR = @prefix@/etc
-MAILCAPLIBDIR = @prefix@/etc
+MIMELIBDIR = /etc
+MAILCAPLIBDIR = /etc
 
 % TeX documentation and source files, for use with kpsewhich.
 TEXDOCS = .;$TEXMF/doc//
 TEXSOURCES = .;$TEXMF/source//
+TEXDOCSSUFFIX = ;.pdf;.ps;..dvi;html;.txt;.tex
+TEXDOCSCOMPRESS = ;.gz;.bz2;.zip;.Z
+TEXDOCEXT = {$TEXDOCSSUFFIX}{$TEXDOCSCOMPRESS}
 
 % Web and CWeb input paths.
 WEBINPUTS = .;$TEXMF/web//
@@ -379,7 +386,7 @@ TEXMFSCRIPTS = $TEXMF/scripts//
 %
 % For security reasons, it is better not to have . part of the path.
 %
-TEXMFCNF = {$SELFAUTOLOC,$SELFAUTODIR,$SELFAUTOPARENT}{,{/share,}/texmf{-local,}/web2c};/.$TETEXDIR;$TEXMF/web2c;@web2c@
+TEXMFCNF = /etc/texmf;/etc/texmf/web2c;/var/lib/texmf/web2c;@web2c@
 
 # $progname: kpathsea v. 3.5.3 or later overwrites this at runtime. To
 # avoid empty expansions from binaries linked against an earlier
@@ -468,9 +475,9 @@ MPXCOMMAND = makempx
 % For some xy-pic samples, you may need as much as 700000 words of memory.
 % For the vast majority of documents, 60000 or less will do.
 %
-main_memory = 1500000 % words of inimemory available; also applies to inimf&mp
-extra_mem_top = 0     % extra high memory for chars, tokens, etc.
-extra_mem_bot = 0     % extra low memory for boxes, glue, breakpoints, etc.
+main_memory = 3500000 % words of inimemory available; also applies to inimf&mp
+extra_mem_top = 0     % extra high memory for chars, tokens, etc. (has to be 0 for omega)
+extra_mem_bot = 0     % extra low memory for boxes, glue, breakpoints, etc. (has to be 0 for omega)
 
 % ConTeXt needs lots of memory.
 extra_mem_top.context = 2000000
@@ -542,3 +549,33 @@ gf_buf_size = 16384  % MF
 error_line = 79
 half_error_line = 50
 max_print_line = 79
+
+% These are xmltex specific
+main_memory.xmltex = 1500000
+param_size.xmltex = 1500
+stack_size.xmltex = 1500
+hash_extra.xmltex = 50000
+string_vacancies.xmltex = 45000
+pool_free.xmltex = 47500
+nest_size.xmltex = 500
+save_size.xmltex = 10000
+pool_size.xmltex = 500000
+max_strings.xmltex = 55000
+
+% These are pdfxmltex specific
+main_memory.pdfxmltex = 2500000
+param_size.pdfxmltex = 1500
+stack_size.pdfxmltex = 1500
+hash_extra.pdfxmltex = 50000
+string_vacancies.pdfxmltex = 45000
+pool_free.pdfxmltex = 47500
+nest_size.pdfxmltex = 500
+save_size.pdfxmltex = 10000
+pool_size.pdfxmltex = 500000
+max_strings.pdfxmltex = 55000
+
+% These are jadetex specific
+main_memory.jadetex = 499999
+hash_extra.jadetex = 25000
+pool_size.jadetex = 500000
+save_size.jadetex = 15000
--- texk/make/makevars.mk
+++ texk/make/makevars.mk	2006-08-16 13:29:16.000000000 +0200
@@ -5,7 +5,8 @@ makevars = prefix=$(prefix) exec_prefix=
   bindir=$(bindir) scriptdir=$(scriptdir) libdir=$(libdir) \
   datadir=$(datadir) infodir=$(infodir) includedir=$(includedir) \
   mandir=$(mandir) manext=$(manext) man1dir=$(man1dir) \
-  texmf=$(texmf) web2cdir=$(web2cdir) vartexfonts=$(vartexfonts)\
+  texmf=$(texmf) web2cdir=$(web2cdir) texmfconf=$(texmfconf) \
+  texmfvar=$(texmfvar) vartexfonts=$(vartexfonts) \
   texinputdir=$(texinputdir) mfinputdir=$(mfinputdir) mpinputdir=$(mpinputdir)\
   fontdir=$(fontdir) fmtdir=$(fmtdir) basedir=$(basedir) memdir=$(memdir) \
   texpooldir=$(texpooldir) mfpooldir=$(mfpooldir) mppooldir=$(mppooldir) \
--- texk/make/paths.mk
+++ texk/make/paths.mk	2006-08-16 13:42:37.000000000 +0200
@@ -30,6 +30,12 @@ includedir = @includedir@
 # GNU .info* files.
 infodir = @infodir@
 
+# System configuration directory
+sysconfdir = @sysconfdir@
+
+# System status directory
+localstatedir = @localstatedir@
+
 # Unix man pages.
 manext = 1
 mandir = @mandir@
@@ -46,8 +52,12 @@ man1dir = $(mandir)/man$(manext)
 # The root of the main tree.
 texmf = @texmfmain@
 
-# The directory used by varfonts.
-vartexfonts = /var/tmp/texfonts
+# FHS-2.0 and higher requires /var/cache/fonts/, we need also a rw dir
+# /var/lib/texmf/ for formats and other variable data.
+# This because it should be possible to have a ro mounted /usr/.
+texmfconf = $(sysconfdir)/texmf
+texmfvar = $(localstatedir)/texmf
+vartexfonts = /var/cache/fonts
 
 # Regular input files.
 texinputdir = $(texmf)/tex
--- texk/ps2pkm/pk2bm.c
+++ texk/ps2pkm/pk2bm.c	2006-08-16 13:29:16.000000000 +0200
@@ -41,8 +41,7 @@ int main(int argc, char *argv[])
    quarterword lsbf();
    void dots();
    chardesc cd;
-   char *myname = "pk2bm", *pkname;
-   int atoo(char *);
+   char *myname = "pk2bm", *pkname, *endptr;
 	
    while (--argc > 0 && (*++argv)[0] == '-') {
       done=0;
@@ -50,26 +49,36 @@ int main(int argc, char *argv[])
          switch (c) {
       	 case 'c':
       	    if (*++argv[0] == '\0') {
-      	       argc--;  argv++;
+               if (--argc == 0) {
+err:
+                 printf("%s: illegal value for option %c\n", myname, c);
+                 exit(1);
+               }
+      	       argv++;
       	    }
       	    C = *argv[0];
       	    done = 1; break;
       	 case 'o':
       	    if (*++argv[0] == '\0') {
-      	       argc--;  ++argv;
+               if (--argc == 0) goto err;
+      	       ++argv;
       	    }
-      	    C = atoo(argv[0]);
+      	    C = strtol(argv[0], &endptr, 8);
+            if (endptr==argv[0] || *endptr) goto err;
       	    done = 1; break;
       	 case 'H':
       	    if (*++argv[0] == '\0') {
-      	       argc--; argv++;
+               if (--argc == 0) goto err;
+      	       argv++;
       	    }
-      	    h = atoi(argv[0]);
+      	    h = strtol(argv[0], &endptr, 10);
+            if (endptr==argv[0] || *endptr) goto err;
             done=1;
       	    break;
       	 case 'W':
       	    if (*++argv[0] == '\0') {
-      	       argc--; argv++;
+               if (--argc == 0) goto err;
+      	       argv++;
       	    }
       	    w = atoi(argv[0]);
 	    done=1;
@@ -86,7 +95,7 @@ int main(int argc, char *argv[])
       	 }
    }
 
-   if (argc == 0) {
+   if (argc != 1) {
       printf("Usage: %s [-bh] {-c char|-o octchar} [-W width -H height] pkfile\n", myname);
       exit(1);
    }
@@ -199,8 +208,3 @@ quarterword u; int n;
    }
 }
 
-int atoo(char *oct)
-{  int octal = 0;
-   while (*oct != '\0') octal = 8*octal + (*oct++) - '0';
-   return octal & 0xff;
-}
--- texk/tetex/fmtutil
+++ texk/tetex/fmtutil	2006-08-16 14:10:42.000000000 +0200
@@ -112,7 +112,7 @@ setupTmpDir()
 
   trap 'cleanup 1' 1 2 3 7 13 15
   needsCleanup=true
-  (umask 077; mkdir "$tmpdir") \
+  (umask 077; mkdir -m 0700 "$tmpdir") \
     || abort "could not create directory \`$tmpdir'"
 }
 
@@ -360,7 +360,7 @@ main()
   need_find_hyphenfile=false
   cfgparam=
   cfgmaint=
-  tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$
+  tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/$progname.$$.$RANDOM
   verboseFlag=true
 
   # mktexfmtMode: if called as mktexfmt, set to true. Will echo the
@@ -677,7 +677,14 @@ run_initex()
     *)       prgswitch=-progname=$format;;
   esac
 
+  type -p "$engine" &> /dev/null || return
   rm -f $fmtfile
+  test "$batchmode" = "yes" && {
+    case "$engine" in
+      tex|ptex)
+	texargs="\\batchmode \\input $texargs"
+    esac
+  }
   verboseMsg "$progname: running \`$engine -ini  $tcxflag $jobswitch $prgswitch $texargs' ..."
 
   # run in a subshell to get a local effect of TEXPOOL manipulation:
--- texk/tetex/texconfig
+++ texk/tetex/texconfig	2006-08-16 14:09:09.000000000 +0200
@@ -37,7 +37,7 @@ envVars="
   TEXMFDBS TEXMFINI TEXMFSCRIPTS TEXPICTS TEXPKS TEXPOOL TEXPSHEADERS
   TEXSOURCES TFMFONTS TRFONTS TTFONTS VFFONTS WEB2C WEBINPUTS
 "
-tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/tctmp.$$
+tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/tctmp.$$.$RANDOM
 needsCleanup=false
 lastUpdatedFile=
 
@@ -181,6 +181,10 @@ findDialogProg()
 ###############################################################################
 runDialog()
 {
+  if test ! -t 0 -o ! -t 1 ; then
+    echo ${1+"$@"}
+    return
+  fi
   test -z "$NO_CLEAR" && tty -s && clear
   case "$DIALOG_PROG" in
     "")
@@ -1309,7 +1313,7 @@ Valid PAPER settings:
       ;;
 
     rehash)
-      mktexlsr
+      ( unset KPSE_DOT; mktexlsr )
       ;;
 
     # handle "xdvi paper PAPER"
--- texk/tetex/texconfig-dialog
+++ texk/tetex/texconfig-dialog	2006-08-16 13:29:16.000000000 +0200
@@ -159,7 +159,14 @@ termCtl()
 ###############################################################################
 menuMain()
 {
-  cat <<-'eof'
+  rows="$(stty size)"
+  columns=${rows##* }
+  rows=${rows%% *}
+  test -n "$rows"	|| rows=0
+  test -n "$columns"	|| columns=0
+
+  if test $rows -lt 24 -a $columns -lt 80 ; then
+    cat <<-'eof'
 	The interactive texconfig utility will be started now. Make sure
 	your screen has at least 24 rows and 80 columns. If texconfig
 	crashes now, you can still set up your teTeX system using the
@@ -168,8 +175,9 @@ menuMain()
 
 	The interactive mode works best with a real vt100 terminal or
 	inside an xterm window.
-eof
-  termCtl readln
+	eof
+    termCtl readln
+  fi
 
   while :; do
     logMessage='view logfile'
--- texk/tetex/texlinks
+++ texk/tetex/texlinks	2006-08-16 14:07:48.000000000 +0200
@@ -100,7 +100,7 @@ setupTmpDir()
 
   trap 'cleanup 1' 1 2 3 7 13 15
   needsCleanup=true
-  (umask 077; mkdir "$tmpdir") \
+  (umask 077; mkdir -m 0700 "$tmpdir") \
     || abort "could not create directory \`$tmpdir'"
 }
 
@@ -108,16 +108,18 @@ setupTmpDir()
 # search a binary along $PATH:
 check_for_binary()
 {
-  testbin=$1
-  set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g; s/:/ /g'`; shift
-  for i
-  do
-    if [ -x "$i/$testbin" ]; then
-      echo "$i/$testbin"
-      return 0
-    fi
-  done
-  return 1
+# testbin=$1
+# set x `echo "$PATH" | sed 's/^:/.:/; s/:$/:./; s/::/:.:/g; s/:/ /g'`; shift
+# for i
+# do
+#   if [ -x "$i/$testbin" ]; then
+#     echo "$i/$testbin"
+#     return 0
+#   fi
+# done
+# return 1
+
+  type -p $1
 }
 
 
@@ -199,8 +201,22 @@ search_symlinkdir()
 upd_symlinkdir()
 {
   search_symlinkdir || return 0
-  for i in `sed 's@ .*@@' cnf_file_ln.$$`; do
-    install_link "$selfautoloc/$i" "$symlinkdir/$i"
+  set x `cat cnf_file_ln.$$` ; shift
+  while test $# != 0; do
+    fmt=$1; ini=$3; shift; shift; shift
+
+    # Some broken shells destroy the positional arguments when calling a
+    # shellfunction. Therefore, we save and restore them "by hand" in the
+    # main_args_while variable.
+    main_args_while="$@"
+
+    kpsewhich -progname=$fmt -format=tex $ini >/dev/null 2>&1
+    test $? -ne 0 && continue
+
+    install_link "$selfautoloc/$fmt" "$symlinkdir/$fmt"
+
+    # restore positional arguments:
+    set x $main_args_while; shift
   done
 }
 
@@ -243,12 +259,12 @@ main()
   test -f "$cnf_file" || abort "config file \`$cnf' not found"
 
 
-  tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/texlinks.$$
+  tmpdir=${TMPDIR-${TEMP-${TMP-/tmp}}}/texlinks.$$.$RANDOM
   setupTmpDir
   cd "$tmpdir" || cleanup 1
 
-  sed '/^[ 	]*#/d; /^[ 	]*$/d' $cnf_file \
-    | awk '{print $1, $2}' > cnf_file_ln.$$
+  sed '/^[ 	]*#/d; /^[ 	]*$/d; s%\*%%' $cnf_file \
+    | awk '{print $1, $2, $NF}' > cnf_file_ln.$$
 
   if test -z "$dirs"; then
     if test $multiplatform = true; then
@@ -269,13 +285,16 @@ main()
     # cnf_file_ln.$$ has lines with "format engine" pairs
     set x `cat cnf_file_ln.$$`; shift
     while test $# != 0; do
-      fmt=$1; engine=$2; shift; shift
+      fmt=$1; engine=$2; ini=$3; shift; shift; shift
 
       # Some broken shells destroy the positional arguments when calling a
       # shellfunction. Therefore, we save and restore them "by hand" in the
       # main_args_while variable.
       main_args_while="$@"
 
+      kpsewhich -progname=$fmt -format=tex $ini >/dev/null 2>&1
+      test $? -ne 0 && continue
+
       test "x$fmt" = "x$engine" && continue
       if test -f "$d/$engine"; then
         install_link "$engine" "$d/$fmt"
--- texk/web2c/Makefile.in
+++ texk/web2c/Makefile.in	2007-04-27 11:15:37.000000000 +0000
@@ -67,7 +67,7 @@
 # With --enable-ipc, TeX may need to link with -lsocket.
 socketlibs = @socketlibs@
 
-common_makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS)' $(XMAKEARGS)
+common_makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' CXXFLAGS='$(CXXFLAGS)' LDFLAGS='$(LDFLAGS)' $(XMAKEARGS)
 window_makeargs = x_cppflags='$(x_cppflags)' $(common_makeargs)
 install_makeargs = INSTALL='$(INSTALL)' INSTALL_DATA='$(INSTALL_DATA)' \
   INSTALL_PROGRAM='$(INSTALL_PROGRAM)' \
--- texk/web2c/fmtutil.in
+++ texk/web2c/fmtutil.in	2008-03-05 15:35:00.000000000 +0000
@@ -69,16 +69,16 @@ amstex	pdftex		-		-translate-file=cp227.
 #! pdfamstex	pdftex			-	-translate-file=cp227.tcx *pdfamstex.ini
 
 # Context formats:
-#! cont-cz	pdftex		cont-usr.tex	-8bit *cont-cz.ini
-#! cont-cz	xetex		cont-usr.tex	-8bit *cont-cz.ini
-#! cont-de	pdftex		cont-usr.tex	-8bit *cont-de.ini
-#! cont-de	xetex		cont-usr.tex	-8bit *cont-de.ini
+cont-cz	pdftex		cont-usr.tex	-8bit *cont-cz.ini
+cont-cz	xetex		cont-usr.tex	-8bit *cont-cz.ini
+cont-de	pdftex		cont-usr.tex	-8bit *cont-de.ini
+cont-de	xetex		cont-usr.tex	-8bit *cont-de.ini
 cont-en	pdftex		cont-usr.tex	-8bit *cont-en.ini
 cont-en	xetex		cont-usr.tex	-8bit *cont-en.ini
-#! cont-nl	pdftex		cont-usr.tex	-8bit *cont-nl.ini
-#! cont-nl	xetex		cont-usr.tex	-8bit *cont-nl.ini
-#! cont-uk	pdftex		cont-usr.tex	-8bit *cont-uk.ini
-#! cont-uk	xetex		cont-usr.tex	-8bit *cont-uk.ini
+cont-nl	pdftex		cont-usr.tex	-8bit *cont-nl.ini
+cont-nl	xetex		cont-usr.tex	-8bit *cont-nl.ini
+cont-uk	pdftex		cont-usr.tex	-8bit *cont-uk.ini
+cont-uk	xetex		cont-usr.tex	-8bit *cont-uk.ini
 
 # language-specific things:
 
@@ -133,7 +133,14 @@ physe		pdftex	-		physe.ini
 phyzzx		pdftex	-		physe.ini
 
 # formats with dependencies on earlier formats
-xmltex		pdftex	language.dat	&latex xmltex.ini
-pdfxmltex	pdftex	language.dat	&pdflatex pdfxmltex.ini
-jadetex		pdftex	language.dat	&latex jadetex.ini
-pdfjadetex	pdftex	language.dat	&pdflatex pdfjadetex.ini
+xmltex		pdftex	language.dat	-translate-file=cp227.tcx &latex xmltex.ini
+pdfxmltex	pdftex	language.dat	-translate-file=cp227.tcx &pdflatex pdfxmltex.ini
+jadetex		pdftex	language.dat	-translate-file=cp227.tcx &latex jadetex.ini
+pdfjadetex	pdftex	language.dat	-translate-file=cp227.tcx &pdflatex pdfjadetex.ini
+
+# formats for MusixTeX/MusicTeX
+musixtex	pdftex	-		-translate-file=cp227.tcx &etex musixtex.ins
+pdfmusixtex	pdftex	-		-translate-file=cp227.tcx &pdfetex pdfmusixtex.ins
+#! musictex	pdftex	-		-translate-file=cp227.tcx &etex musictex.ins
+#! pdfmusictex	pdftex	-		-translate-file=cp227.tcx &pdfetex pdfmusictex.ins
+
--- texk/web2c/metapost.mk
+++ texk/web2c/metapost.mk	2007-02-20 17:53:51.000000000 +0000
@@ -9,6 +9,7 @@ Makefile: metapost.mk
 
 metapost = mpost dvitomp
 mpostdir = mpdir
+mpost = $(metapost)
 
 # mpware is the subdirectory.
 mpware = mpware
--- texk/web2c/pdftexdir/Makefile.in
+++ texk/web2c/pdftexdir/Makefile.in	2007-02-06 16:52:15.000000000 +0100
@@ -33,7 +33,7 @@ LIBOBSDCOMPATDIR=../../../libs/obsdcompa
 LIBOBSDCOMPATFSRCDIR=$(srcdir)/$(LIBOBSDCOMPATDIR)
 
 XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../.. -I$(LIBMD5DIR) \
-  -I$(LIBMD5SRCDIR) @LIBPNGCPPFLAGS@ @ZLIBCPPFLAGS@ \
+  -I$(LIBMD5SRCDIR) @LIBPNGCPPFLAGS@ @ZLIBCPPFLAGS@ @LIBXPDFCPPFLAGS@ \
   -I$(LIBXPDFDIR) -I$(LIBXPDFDIR)/.. -I$(LIBXPDFSRCDIR) -I$(LIBXPDFSRCDIR)/.. \
   -I$(LIBOBSDCOMPATDIR) -I$(LIBOBSDCOMPATDIR)/.. -I$(LIBOBSDCOMPATFSRCDIR) \
   -I$(LIBOBSDCOMPATFSRCDIR)/.. -DpdfTeX
--- texk/web2c/window/regis.c
+++ texk/web2c/window/regis.c	2006-08-16 13:29:16.000000000 +0200
@@ -62,12 +62,14 @@ void mf_regis_blankrectangle P4C(screenc
                                  screenrow, top,
                                  screenrow, bottom)
 {
-	printf(
+	const char *format =
 #ifdef WRITEWHITE
-	"%cPpP[%d,%d]W(I0)W(S1)V[%d,%d]V[%d,%d]V[%d,%d]V[%d,%d]W(S0)W(I3)%c\\",
+	"%cPpP[%d,%d]W(I0)W(S1)V[%d,%d]V[%d,%d]V[%d,%d]V[%d,%d]W(S0)W(I3)%c\\"
 #else
-	"%cPpP[%d,%d]W(I3)W(S1)V[%d,%d]V[%d,%d]V[%d,%d]V[%d,%d]W(S0)W(I0)%c\\",
+	"%cPpP[%d,%d]W(I3)W(S1)V[%d,%d]V[%d,%d]V[%d,%d]V[%d,%d]W(S0)W(I0)%c\\"
 #endif
+	  ;
+	printf(format,
 		ESCAPE,left,bottom,right,bottom,right,top,left,top,
 		left,bottom,ESCAPE);
 }
--- texk/web2c/window/x11-Xlib.c
+++ texk/web2c/window/x11-Xlib.c	2006-08-16 13:29:16.000000000 +0200
@@ -73,6 +73,8 @@ static XWMHints wm_hints = {
 #define BORDER_WIDTH 1 /* Should get this from resource. */
 #define DEFAULT_X_POSITION 0
 #define DEFAULT_Y_POSITION 0
+#define DEFAULT_WIDTH 450
+#define DEFAULT_DEPTH 500
 
 
 /* Return 1 (i.e., true) if display opened successfully, else 0.  */
@@ -99,11 +101,11 @@ mf_x11_initscreen()
     
     sizehints.x = DEFAULT_X_POSITION;
     sizehints.y = DEFAULT_Y_POSITION;
-    sizehints.width = screenwidth;
-    sizehints.height = screendepth;
+    sizehints.width = DEFAULT_WIDTH;
+    sizehints.height = DEFAULT_DEPTH;
     sizehints.flags = PPosition|PSize;
 
-    sprintf (default_geometry, "%ux%u+%u+%u", screenwidth, screendepth,
+    sprintf (default_geometry, "%ux%u+%u+%u", DEFAULT_WIDTH, DEFAULT_DEPTH,
                                DEFAULT_X_POSITION, DEFAULT_Y_POSITION);
 
     /* Look up the geometry for this window. (Section 10.2 Obtaining X
--- texk/web2c/window/x11-Xt.c
+++ texk/web2c/window/x11-Xt.c	2006-08-16 13:29:16.000000000 +0200
@@ -23,8 +23,8 @@
 
 #define PLANE 0
 
-static unsigned int mf_defwidth = 0;
-static unsigned int mf_defheight = 0;
+static unsigned int mf_defwidth = 450;;
+static unsigned int mf_defheight = 500;
 
 static Display *mf_display;
 static Window mf_window;
--- texk/xdvik/psgs.c
+++ texk/xdvik/psgs.c	2006-08-16 13:29:16.000000000 +0200
@@ -30,6 +30,8 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <sys/time.h>	/* for timeval */
 
 #include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 
 /* Condition for retrying a write */
 #include <errno.h>
@@ -614,6 +616,26 @@ initGS(void)
 	perror("[xdvik] pipe");
 	return False;
     }
+
+    if (GS_pid > 0) { /* Check if we've a running ghostscript */
+	int status, n = 0;
+	errno = 0;
+retry:
+	switch (waitpid(GS_pid, &status, WNOHANG)) {
+	case -1:
+	    if (errno == EINTR)
+		goto retry;
+	    return False;
+	case 0:
+	    break;
+	default:
+	    if (WIFEXITED(status) && WEXITSTATUS(status))
+		return False;
+	    if (WIFSIGNALED(status))
+		return False;
+	    break; /* Not reached */
+	}
+    }
     fflush(stderr);	/* to avoid double flushing */
     GS_pid = vfork();
     if (GS_pid == 0) {	/* child */
--- texk/xdvik/xdvi-sh.in
+++ texk/xdvik/xdvi-sh.in	2006-08-16 13:29:16.000000000 +0200
@@ -43,4 +43,19 @@ if test -n "$xdviappfile"; then
   XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH
 fi
 
-exec @final_exec_name@ $NAMEOPT ${1+"$@"}
+uncompress=
+filename="${1+"$@"}"
+case "${filename}" in
+  *.gz)   uncompress="gzip  -d -c $filename" ;;
+  *.bz2)  uncompress="bzip2 -d -c $filename" ;;
+esac
+if test -n "$uncompress" -a -r "$filename" ; then
+  filename="${filename##*/}"
+  tmpfile="`mktemp ${TMPDIR-/tmp}/${filename%.*}.XXXXXX`" || exit 1
+  trap 'rc=$?; rm -f $tmpfile; exit $rc' 0 1 2 3 6 13 15
+  $uncompress > $tmpfile
+  exec -a xdvi @final_exec_name@ $NAMEOPT $tmpfile
+else
+  exec -a xdvi @final_exec_name@ $NAMEOPT ${1+"$@"}
+fi
+
openSUSE Build Service is sponsored by