[Debian-tex-commits] SVN tex-common commit + diffs: r5241 - in tex-common/branches/v3: debian doc scripts

Norbert Preining preining at alioth.debian.org
Wed Mar 21 13:18:48 UTC 2012


Author: preining
Date: 2012-03-21 13:18:47 +0000 (Wed, 21 Mar 2012)
New Revision: 5241

Removed:
   tex-common/branches/v3/scripts/language.dat.header
   tex-common/branches/v3/scripts/language.def.header
Modified:
   tex-common/branches/v3/debian/changelog
   tex-common/branches/v3/debian/rules
   tex-common/branches/v3/debian/tex-common.links
   tex-common/branches/v3/doc/Debian-TeX-Policy.sgml
   tex-common/branches/v3/scripts/dh_installtex
   tex-common/branches/v3/scripts/update-fmtlang
Log:
start working on support for language.dat.lua


Modified: tex-common/branches/v3/debian/changelog
===================================================================
--- tex-common/branches/v3/debian/changelog	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/debian/changelog	2012-03-21 13:18:47 UTC (rev 5241)
@@ -1,3 +1,16 @@
+tex-common (3.4) experimental; urgency=low
+
+  * UNRELEASED
+  * implement support for generation of language.dat.lua for luatex
+    based formats:
+    - extended update-fmtlang
+    - change and extended the format of files in hyphen.d (needs rebuild
+      of all providing packages!)
+    - adapt dh_installtex for new format
+  * start fixing the TeX-Debian-Policy document
+
+ -- Norbert Preining <preining at debian.org>  Wed, 21 Mar 2012 22:14:41 +0900
+
 tex-common (3.3) experimental; urgency=low
 
   [ Norbert Preining ]

Modified: tex-common/branches/v3/debian/rules
===================================================================
--- tex-common/branches/v3/debian/rules	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/debian/rules	2012-03-21 13:18:47 UTC (rev 5241)
@@ -16,8 +16,7 @@
 bin_manpages=$(foreach script,$(bin_scripts), scripts/$(script).1) 
 
 nonbin_installfiles=$(foreach script,$(nonbin_scripts), scripts/$(script)) \
-	texmf/web2c/mktex.cnf scripts/language.def.header \
-	scripts/language.dat.header
+	texmf/web2c/mktex.cnf 
 
 build: build-stamp
 

Modified: tex-common/branches/v3/debian/tex-common.links
===================================================================
--- tex-common/branches/v3/debian/tex-common.links	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/debian/tex-common.links	2012-03-21 13:18:47 UTC (rev 5241)
@@ -2,9 +2,11 @@
 usr/share/man/man8/update-fmtlang.8 usr/share/man/man8/update-language.8
 usr/share/man/man8/update-fmtlang.8 usr/share/man/man8/update-language-def.8
 usr/share/man/man8/update-fmtlang.8 usr/share/man/man8/update-language-dat.8
+usr/share/man/man8/update-fmtlang.8 usr/share/man/man8/update-language-lua.8
 usr/sbin/update-fmtlang usr/sbin/update-fmtutil
 usr/sbin/update-fmtlang usr/sbin/update-language
 usr/sbin/update-fmtlang usr/sbin/update-language-def
 usr/sbin/update-fmtlang usr/sbin/update-language-dat
+usr/sbin/update-fmtlang usr/sbin/update-language-lua
 var/lib/texmf/ls-R-TEXMFMAIN usr/share/texmf/ls-R
 usr/share/doc/texmf usr/share/texmf/doc

Modified: tex-common/branches/v3/doc/Debian-TeX-Policy.sgml
===================================================================
--- tex-common/branches/v3/doc/Debian-TeX-Policy.sgml	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/doc/Debian-TeX-Policy.sgml	2012-03-21 13:18:47 UTC (rev 5241)
@@ -18,7 +18,7 @@
 
       <copyright>
 	<copyrightsummary>
-	  Copyright © 2004-2006 Frank Küster, Richard Lewis, Norbert
+	  Copyright © 2004-2012 Frank Küster, Richard Lewis, Norbert
           Preining, Ralf Stubner, Florent Rougon
 	</copyrightsummary>
 	<p>
@@ -168,7 +168,7 @@
 	<item>
 	  A package that only installs TeX input files, e.g. a new
 	  LaTeX package, should install them in
-	  the <var>TEXMFMAIN</var> tree
+	  the <var>TEXMFDEBIAN</var> tree
 	  (<file>/usr/share/texmf/</file>) at the place indicated by
 	  the TDS,
 	  see <url id="file:///usr/share/doc/tex-common/tds.html"
@@ -194,7 +194,7 @@
       </p>
       <p>
 	Depending on the <package>texlive-*</package>
-	or <package>tetex-*</package> metapackages is only acceptable
+	metapackages is only acceptable
 	for editors, IDEs and other tools which handle user-generated
 	code.  TeX add-on packages, as well as automated input
 	generators etc., must instead depend on a list of individual
@@ -259,12 +259,12 @@
         The following <var>TEXMF</var> trees are defined, as outlined
         below:
         <enumlist>
-          <item><file>/usr/share/texmf-tetex/</file>, part of <var>TEXMFDIST</var></item>
-          <item><file>/usr/share/texmf-texlive/</file>, part of <var>TEXMFDIST</var></item>
-          <item><file>/usr/share/texmf/</file>, referenced as <var>TEXMFMAIN</var></item>
+          <item><file>/usr/share/texlive/texmf-dist/</file>, referenced as <var>TEXMFDIST</var></item>
+          <item><file>/usr/local/share/texmf/</file>, referenced as <var>TEXMFLOCAL</var></item>
+          <item><file>/usr/share/texlive/texmf/</file>, referenced as <var>TEXMFMAIN</var></item>
+          <item><file>/usr/share/texmf/</file>, referenced as <var>TEXMFDEBIAN</var></item>
           <item><file>/var/lib/texmf/</file>, referenced as <var>TEXMFSYSVAR</var></item>
           <item><file>/etc/texmf/</file>, referenced as <var>TEXMFSYSCONFIG</var></item>
-          <item><file>/usr/local/share/texmf/</file>, referenced as <var>TEXMFLOCAL</var></item>
           <item> Any directories listed in the <var>TEXMFHOME</var> configuration
                  variable in <file>texmf.cnf</file> or as an environment
                  variable,
@@ -281,44 +281,18 @@
 
 	  <p>
 	  The role of the trees <var>TEXMFMAIN</var> and
-          <var>TEXMFDIST</var> in Debian differ from upstream's
-          original usage.  Upstream uses <var>TEXMFMAIN</var> for the
+          <var>TEXMFDIST</var> in Debian parallels the usage in
+	  upstream TeX Live. Upstream uses <var>TEXMFMAIN</var> for the
           files that have to match the binary executables and
           <var>TEXMFDIST</var> for other TeX input files that are
-          replaced when a new texmf tarball appears; this distinction
-          is not necessary on a system with a decent package managment
-          system.  Instead, the basic TeX packages install their files
-          into their <var>TEXMFDIST</var> directories <footnote>This
-          is new, and the basic TeX packages currently transition
-          their files to the new place.</footnote> , while
-          <var>TEXMFMAIN</var> is used by TeX add-on packages for
-          their files and allows them to shadow older versions
-          provided by the basic TeX packages.
-	  A couple of files from the basic TeX packages still need to be
-	  placed in <var>TEXMFMAIN</var>
-	  <footnote>
-	    Reasons include hardcoded paths in executables as well as
-	    the need for e.g. pool files to exactly match the binaries'
-	    version, so that shadowing must be prevented.
-	  </footnote>.
+          replaced when a new texmf tarball appears; 
+	  <var>TEXMFDEBIAN</var> is an additional tree where TeX add-on
+	  packages can put their files.
 	  </p>
 
         <p>
-	The order of basic TeX packages in <var>TEXMFDIST</var> may be
-	changed by the user or by the basic TeX packages, and no
-	implementation may rely on a particular order.  This implies
-	that for a package that needs a version of a particular file
-	newer than provided by one of the basic TeX packages, it is
-	not sufficient to declare a dependency on the other basic TeX
-	package(s)<footnote>Of course this is only a problem if the
-	file is needed in the configure phase.  If it is needed only
-	at runtime, a README file to instruct the local admin should be
-	sufficient.</footnote>.
-        </p>
-
-        <p>
         Debian packages generally install files in
-        <var>TEXMFMAIN</var>, and may ship or create empty directories
+        <var>TEXMFDEBIAN</var>, and may ship or create empty directories
         in the other trees, in accordance with Debian Policy.
         Configuration file handling in <var>TEXMFSYSCONFIG</var> is
         described below in <ref id="configurationfiles">.  Packages
@@ -350,10 +324,10 @@
 	</p>
 
 	<p>An exception is the generated file
-        <file>/etc/texmf/texmf.cnf</file>.  It is not intended that
-        local administrators edit that file, but if they do, the
-        configuration update programs must respect these changes.
-        Debian packages must not alter that file.
+        <file>/etc/texmf/web2c/texmf.cnf</file>. 
+	Local administrators should not edit this file, as manual
+	changes will be overwritten later on. Instead, configuration
+	file snippets in <file>/etc/texmf/texmf.d</file> must be used.
 	</p>
 
       </sect>
@@ -382,7 +356,7 @@
 	  <p>Packages that need newer versions of a file than already
 	  supplied by a basic TeX package and installed in
 	  <var>TEXMFDIST</var> can place them into
-	  <var>TEXMFMAIN</var>.  Thus, the outdated file will be
+	  <var>TEXMFDEBIAN</var>.  Thus, the outdated file will be
 	  shadowed, and the new one is in effect.  
 	  </p>
 
@@ -495,13 +469,56 @@
 	for TeX input files and can be used by packages for
 	configuration files that are not TeX input files (e.g. the
 	files in subdirectories <file>fmt.d</file> or
-	<file>updmap.d</file>).
+	<file>hyphen.d</file>).
 	</p>
       </sect>
       <sect id="update-progs">
         <heading>Configuration update programs</heading>
 
+
 	<p>
+	Configuration files in the TeX world come in two classes: stackable
+	and unstackable. The first class means that the respective programs
+	read <em>all</em> configuration files found, while in the later case
+	only the top or first configuration file is used.
+	</p>
+
+	<p>
+	Stackable configuration files in TeX are 
+	<file>TEXMFTREE/web2c/texmf.cnf</file> (central configuration
+	for TeX applications) and
+	<file>TEXMFTREE/web2c/updmap.cfg</file> (font configuration), 
+	while unstackable configuration files are 
+	<file>TEXMFTREE/tex/generic/config/language.dat</file> (language
+	support/hyphenation patterns for latex based formats),
+	<file>TEXMFTREE/tex/generic/config/language.def</file> (the same
+	for etex based formats),
+	<file>TEXMFTREE/tex/generic/config/language.def.lua</file> (the
+	same for luatex based formats), and
+	<file>TEXMFTREE/web2c/fmtutil.cnf</file> (for format definitions).
+	</p>
+
+	<p>
+	In Debian, by default the respective configuration files of the
+	following trees are used: For <file>texmf.cnf</file>: TEXMFDEBIAN
+	(the texmf.cnf file is a link to the one in TEXMFMAIN).
+	For <file>updmap.cfg</file>:TEXMFDIST, TEXMFDEBIAN.
+	For the unstackable configuration files the respective copies
+	in TEXMFSYSVAR are used.
+	</p>
+
+	<p>
+	The stackable configuration files are either status (texmf.cnf)
+	or generated automatically in the background without any
+	need for configuration, since changes can be included in a
+	higher order configuration file.
+	</p>
+
+	WARNING WARNING: WE HAVE TO REWORK THE WHOLE TEX-COMMON
+	HYPHENATION MECHANISM!!! FOR language.def and language.def.lua
+	!!!!!!!!!!!!!!!!1
+
+	<p>
 	The central configuration file for TeX applications is
 	<file>/etc/texmf/texmf.cnf</file>, the central font configuration
 	file is <file>/var/lib/texmf/web2c/updmap.cfg</file>, the central

Modified: tex-common/branches/v3/scripts/dh_installtex
===================================================================
--- tex-common/branches/v3/scripts/dh_installtex	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/scripts/dh_installtex	2012-03-21 13:18:47 UTC (rev 5241)
@@ -84,8 +84,8 @@
 
         dh_installtex mapfile=foo.cfg formatfile=debian/bar.cnf=42
 
-would install foo.cfg as /etc/texmf/updmap.d/20foo.cfg, and debian/bar.cnf
-as /etc/texmf/fmt.d/42bar.cnf.
+would install foo.cfg as /var/lib/tex-common/fontmap-cfg/texmf/foo.cfg, 
+and debian/bar.cnf as /etc/texmf/fmt.d/42bar.cnf.
 
 
 2) B<Directly on the cmd line:>
@@ -94,15 +94,15 @@
 
 Example:
 
-        dh_installtex map=Map,foo.map hyphen=french,loadhyph-fr.tex,lhm=2,rhm=3,synonym=patois,synonym=francais
+        dh_installtex map=Map,foo.map hyphen=ngerman-x-2011-07-01,dehyphn-x-2011-07-01.tex,hyph-de-1996.pat.txt,lhm=2,rhm=2,synonym=ngerman-x-latest,exceptions=hyph-de-1996.hyp.txt
 
-would install a file /etc/texmf/updmap.d/20package.cfg containing the line
+would install a file /var/lib/tex-common/fontmap-cfg/texmf/package.cfg containing the line
 
         Map foo.map
 
 and a file /etc/texmf/hyphen.d/20package.cnf containing the lines
 
-	name=french file=loadhyphen-fr.tex lefthyphenmin=2 righthyphenmin=3 synonyms=patois,francais
+    name=ngerman-x-2011-07-01 file=dehyphn-x-2011-07-01.tex file_patterns=hyph-de-1996.pat.txt lefthyphenmin=2 righthyphenmin=2 synonym=ngerman-x-latest file_exceptions=hyph-de-1996.hyp.txt
 
 3) B<Package files:>
 You create a file debian/package.maps or debian/maps,
@@ -118,8 +118,8 @@
 
         dh_installtex
 
-would install a present debian/package.maps file as
-/etc/texmf/updmap.d/20package.cfg.
+would install a present debian/package.formats file as
+/etc/texmf/fmt.d/20package.cnf.
 
 
 =head2 Mixing the different variants
@@ -344,11 +344,12 @@
 		my $ret = "$format\t$engine\t$pat\t" . join(",", at rest);
 		return($ret);
 	} elsif ($type eq "hyphen") {
-		my ($lang,$pat, at rest) = split(",",$line);
-		my $ret="name=$lang file=$pat";
+		my ($lang,$loader,$pat, at rest) = split(",",$line);
+		my $ret="name=$lang file=$loader file_patterns=$pat";
 		my @synonyms = ();
 		my $lhm;
 		my $rhm;
+		my $exceptions;
 		foreach (@rest) {
 			my ($a,$b) = split("=", $_, 2);
 			if ($a eq "lhm") {
@@ -357,12 +358,15 @@
 				$rhm = $b;
 			} elsif ($a eq "synonym") {
 				push @synonyms, $b;
+			} elsif ($a eq "exceptions") {
+				$exceptions = $b;
 			} else {
 				error("$line is not well formed.");
 			}
 		}
 		$ret .= " lefthyphenmin=$lhm" if defined($lhm);
 		$ret .= " righthyphenmin=$rhm" if defined($rhm);
+		$ret .= " file_exceptions=$exceptions" if defined($exceptions);
 		if ($#synonyms >= 0) {
 			$ret .= " synonyms=" . join(",", at synonyms);
 		}

Deleted: tex-common/branches/v3/scripts/language.dat.header
===================================================================
--- tex-common/branches/v3/scripts/language.dat.header	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/scripts/language.dat.header	2012-03-21 13:18:47 UTC (rev 5241)
@@ -1,29 +0,0 @@
-% header of the configuration file for language.dat
-%
-% In Debian, language.dat is a file that is generated from
-% configuration files in /etc/texmf/hyphen.d/.  
-%
-% The text of the comments is Copyright 1998, 1999 by Thomas Esser, it
-% is in the Public domain.
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%  To make it possible for package scripts to parse this file, 
-%%  please use only "%! " to comment out hyphenation patterns!
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% CAUTION: the first language will be the default if no style-file
-%          (e.g. german.sty) is used.
-% Since version 3.0 of TeX, hyphenation patterns for multiple languages are
-% possible. Unless you know what you are doing, please let the american
-% english patterns be the first ones. The babel system allows you to
-% easily change the active language for your texts. For more information,
-% have a look to the documentation in texmf/doc/generic/babel.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% The hyphenation pattern files are in the directory:
-%       texmf/tex/generic/hyphen
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-

Deleted: tex-common/branches/v3/scripts/language.def.header
===================================================================
--- tex-common/branches/v3/scripts/language.def.header	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/scripts/language.def.header	2012-03-21 13:18:47 UTC (rev 5241)
@@ -1,25 +0,0 @@
-%% e-TeX V2.0;2
-
-% Note: the first line of this file must match the corresponding line
-% in "etex.src" and "etexdefs.lib", otherwise fallback will be used.
-
-% This is the header for "language.def", e-TeX's language definition file.
-% $Id: language.us.def 9250 2008-07-04 21:15:23Z karl $
-
-% header of the configuration file for language.dat
-%
-% In Debian, language.dat is a file that is generated from
-% configuration files in /etc/texmf/hyphen.d/.  
-
-% It is explicitly permitted to augment this file by adding additional
-% \addlanguage ... commands AFTER the first (\addlanguage {USenglish})
-% which must remain as the first language added to ensure total document
-% portability for pre-\language documents.  The last line of the file
-% MUST be left as \uselanguage {USenglish} for the sane reason.
-
-% Additional languages, patterns, exceptions and left- and right-hyphen
-% minima may be added here, and an example is given for German.
-
-% The five parameters for \addlanguage are:
-% language, patterns file, exceptions file, left- and right-hyphen minima
-

Modified: tex-common/branches/v3/scripts/update-fmtlang
===================================================================
--- tex-common/branches/v3/scripts/update-fmtlang	2012-03-21 11:28:24 UTC (rev 5240)
+++ tex-common/branches/v3/scripts/update-fmtlang	2012-03-21 13:18:47 UTC (rev 5241)
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# update-fmtlang --- Generate updmap.cfg, language.dat, fmtutil.cnf
+# update-fmtlang --- Generate updmap.cfg, language.dat, fmtutil.cnf etc
 #                     from a set of files
 # Copyright (C) 2002 Atsuhito Kohda
 # Copyright (C) 2004, 2005, 2006, 2007 Florent Rougon
@@ -27,13 +27,34 @@
 SYSPATH_BASE=/var/lib/texmf
 
 HYPHENMODE=nohyphen
+HEADFILE=/not/a/real/file/we/ever/will/see/on/a/system
 
 if [ "$progname" = "update-language" ] ; then
     update-language-dat
     update-language-def
+    update-language-lua
     exit 0
+elif [ "$progname" = "update-language-lua" ] ; then
+    CNFDIR=hyphen.d
+    HEADFILE=/usr/share/texlive/texmf/tex/generic/config/language.us.lua
+    HYPHENMODE=luatex
+    # System-wide configuration directory
+    SYSWIDE_CONFDIR=/etc/texmf/$CNFDIR
+    CHECKFILE="$SYSWIDE_CONFDIR/00tex.cnf"
+    EXT="cnf"
+    MEMORY_DIR=/var/lib/tex-common/hyphen-cnf
+    PATH_COMPONENT=tex/generic/config
+    SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
+    DEFAULT_OUTPUTFILE_BASENAME=language.dat.lua
+    SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
+    READCC="%"                      # for COMMENTCHAR
+    WRITECC="--"
+    # in printf, %% is one %
+    PCC="\055\055"                    # for printfCOMMENTCHAR
+    SHORT_DESC="Generate language.dat.lua, the hyphenation configuration file for luaTeX and friends"
 elif [ "$progname" = "update-language-def" ] ; then
     CNFDIR=hyphen.d
+    HEADFILE=/usr/share/texlive/texmf/tex/generic/config/language.us.def
     HYPHENMODE=etex
     # System-wide configuration directory
     SYSWIDE_CONFDIR=/etc/texmf/$CNFDIR
@@ -44,12 +65,14 @@
     SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=language.def
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
-    CC="%"                      # for COMMENTCHAR
+    READCC="%"                      # for COMMENTCHAR
+    WRITECC="%"
     # in printf, %% is one %
     PCC="%%"                    # for printfCOMMENTCHAR
     SHORT_DESC="Generate language.def, the hyphenation configuration file for eTeX and friends"
 elif [ "$progname" = "update-language-dat" ] ; then
     CNFDIR=hyphen.d
+    HEADFILE=/usr/share/texlive/texmf/tex/generic/config/language.us
     HYPHENMODE=latex
     # System-wide configuration directory
     SYSWIDE_CONFDIR=/etc/texmf/$CNFDIR
@@ -60,7 +83,8 @@
     SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=language.dat
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
-    CC="%"                      # for COMMENTCHAR
+    READCC="%"                      # for COMMENTCHAR
+    WRITECC="%"
     # in printf, %% is one %
     PCC="%%"                    # for printfCOMMENTCHAR
     SHORT_DESC="Generate language.dat, the hyphenation configuration file for LaTeX"
@@ -77,7 +101,8 @@
     SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=updmap.cfg
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
-    CC="#"
+    READCC="#"
+    WRITECC="#"
     PCC="#"                     # for printfCOMMENTCHAR
     SHORT_DESC="Generate an updmap configuration file"
 elif [ "$progname" = "update-fmtutil" ] ; then
@@ -91,7 +116,8 @@
     SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
     DEFAULT_OUTPUTFILE_BASENAME=fmtutil.cnf
     SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
-    CC="#"
+    READCC="#"
+    WRITECC="#"
     PCC="#"                     # for printfCOMMENTCHAR
     SHORT_DESC="Generate an fmtutil configuration file"
 else
@@ -135,27 +161,7 @@
 {
     line="$1"
     case "$line" in
-        ${CC}*) echo "$line" >> "$tempfile" ; return ;;
-        USEFILE*) 
-            set -- $line
-            shift
-            datfile="$1"
-            deffile="$2"
-            if [ "$HYPHENMODE" = "etex" ] ; then
-                if [ -r "$deffile" ] ; then
-                    cat "$deffile" >> "$tempfile"
-                else 
-                    echo "${CC} USEFILE $deffile not found" >> "$tempfile"
-                fi
-            else
-                if [ -r "$datfile" ] ; then
-                    cat "$datfile" >> "$tempfile"
-                else 
-                    echo "${CC} USEFILE $datfile not found" >> "$tempfile"
-                fi
-            fi
-            return
-            ;;
+        ${READCC}*) echo "$line" | sed -e "s!^$READCC!$WRITECC !" >> "$tempfile" ; return ;;
     esac
     set -- $line
     name=""
@@ -169,43 +175,58 @@
             lefthyphenmin=*) lhm="${1#lefthyphenmin=}" ;;
             righthyphenmin=*) rhm="${1#righthyphenmin=}" ;;
             synonyms=*) synonyms="${1#synonyms=}" ;;
+            exceptions=*) exceptions=${1#exceptions=}" ;;
+            patterns=*) patterns=${1#patterns=}" ;;
             file=*) f="${1#file=}" ;;
             *) echo "Unknown AddHypen directive ==$line==!" >&2 ; return ;;
         esac
         shift
     done
-    if [ "$name$lhm$rhm$synonyms$f" = "" ] ; then
+    if [ "$name$lhm$rhm$synonyms$f$exceptions$patterns" = "" ] ; then
         return
     fi
-    if [ ! "$lhm$rhm$synonyms$f" = "" ] ; then
+    if [ ! "$lhm$rhm$synonyms$f$exceptions$patterns" = "" ] ; then
         if [ "$name" = "" ] ; then
             echo "the line $line does not contain a name= directive, ignored!" >&2
             return
         fi
     fi
-    if [ ! "$name$lhm$rhm$synonyms" = "" ] ; then
+    if [ ! "$name$lhm$rhm$synonyms$exceptions$patterns" = "" ] ; then
         if [ "$f" = "" ] ; then
             echo "the line $line does not contain a file= directive, ignored!" >&2
             return
         fi
     fi
     if [ "$HYPHENMODE" = "etex" ] ; then
-        printf '\\'"addlanguage{$name}{$f}{}{$lhm}{$rhm}" >> "$tempfile"
-    else
+        printf '\\'"addlanguage{$name}{$f}{}{$lhm}{$rhm}\n" >> "$tempfile"
+    elif [ "$HYPHENMODE" = "latex" ] ; then
         echo "$name $f" >> "$tempfile"
+    elif [ "$HYPHENMODE" = "luatex" ] ; then
+       printf "\t[\' $name \'] = {\n\t\tloader = \'$f\',\n\t\tlefthyphenmin = $lhm,\n\t\trighthyphenmin = $rhm,\n\t\tpatterns = \'$patterns\',\n\t\thyphenation = \'$exceptions\',\n\t\tsynonyms = { " >> "$tempfile"
     fi
     if [ ! "$synonyms" = "" ] ; then
         {
+            first=1
             IFS=",$IFS"
             for s in $synonyms ; do
                 if [ "$HYPHENMODE" = "etex" ] ; then
-                    printf '\\'"addlanguage{$s}{$f}{}{$lhm}{$rhm}" >> "$tempfile"
-                else
+                    printf '\\'"addlanguage{$s}{$f}{}{$lhm}{$rhm}\n" >> "$tempfile"
+                elif [ "$HYPHENMODE" = "latex" ] ; then
                     echo "=$s" >> "$tempfile"
+                elif [ "$HYPHENMODE" = "luatex" ] ; then
+                    if [ $first = 0 ] ; then
+                        printf ", " >> "$tempfile"
+                    else 
+                        first=0
+                    fi
+                    printf "\'$s\'" >> "$tempfile"
                 fi
             done
         }
     fi
+    if [ "$HYPHENMODE" = "luatex" ] ; then
+        printf " }\n\t},\n"  >> "$tempfile"
+    fi
 }
 
 include_hyphen_file_core()
@@ -221,13 +242,13 @@
 {
     file="$1"
 
-    printf "\n${PCC}${PCC}${PCC} From file: $file\n" >>"$tempfile"
+    printf "\n${PCC} ${PCC}${PCC} From file: $file\n" >>"$tempfile"
     if [ $HYPHENMODE = "nohyphen" ] ; then
         cat "$file" >>"$tempfile"
     else
         include_hyphen_file_core "$file"
     fi
-    echo "${CC}${CC}${CC} End of file: $file" >>"$tempfile"
+    echo "${WRITECC} End of file: $file" >>"$tempfile"
     case "$file" in
       */10texlive-latex-base.cnf)
 	seen_latex=1
@@ -242,12 +263,12 @@
 
     cat >>"$tempfile" <<EOF
 
-$CC$CC
-$CC$CC$CC $file not included because either it wasn't
-$CC$CC$CC up-to-date (conffile update pending) or the package shipping it was
-$CC$CC$CC apparently removed (no corresponding .list file in
-$CC$CC$CC $MEMORY_DIR/).
-$CC$CC
+$WRITECC
+$WRITECC $file not included because either it wasn't
+$WRITECC up-to-date (conffile update pending) or the package shipping it was
+$WRITECC apparently removed (no corresponding .list file in
+$WRITECC $MEMORY_DIR/).
+$WRITECC
 EOF
 }
 
@@ -258,13 +279,13 @@
 
     cat >>"$tempfile" <<EOF
 
-$CC$CC
-$CC$CC$CC $file not included because it depends
-$CC$CC$CC on another file that is not included here. For instance, jadetex and
-$CC$CC$CC xmltex snippets are not included in fmtutil.cnf when the snippet for
-$CC$CC$CC LaTeX isn't included itself. This is because the jadetex and xmltex
-$CC$CC$CC formats need the LaTeX format when being built (see bug #427562).
-$CC$CC
+$WRITECC
+$WRITECC $file not included because it depends
+$WRITECC on another file that is not included here. For instance, jadetex and
+$WRITECC xmltex snippets are not included in fmtutil.cnf when the snippet for
+$WRITECC LaTeX isn't included itself. This is because the jadetex and xmltex
+$WRITECC formats need the LaTeX format when being built (see bug #427562).
+$WRITECC
 EOF
 }
 
@@ -751,7 +772,7 @@
 fi
 
 printf "\
-${PCC}${PCC}${PCC} This file was automatically generated by ${progname}.
+${PCC} ${PCC}${PCC} This file was automatically generated by ${progname}.
 ${PCC}
 ${PCC} Please do not edit it directly. If you want to add or change
 ${PCC} anything here, please have a look at the files in:
@@ -760,8 +781,19 @@
 ${PCC}
 ${PCC} and invoke ${progname}.
 ${PCC}
-${PCC}${PCC}${PCC}\n" >> "$tempfile"
+${PCC} ${PCC}${PCC}\n" >> "$tempfile"
 
+#
+# include the necessary files
+if [ ! "$HYPHENMODE" = "nohyphen" ] ; then
+    # we are creating a hyphenation file, include the head file
+    if [ -r "$HEADFILE" ] ; then
+        cat "$HEADFILE" >> "$tempfile"
+    else
+        echo "${WRITECC} HEADFILE $deffile not found" >> "$tempfile"
+    fi
+fi
+
 # From now on, $tempfile must be deleted on exit; therefore, cleanup() should
 # be used.
 
@@ -775,10 +807,13 @@
 # for language.def we have to select the right language at the end
 if [ "$HYPHENMODE" = "etex" ] ; then
     printf "
-${PCC}${PCC}${PCC} No changes may be made beyond this point.
+${PCC} ${PCC}${PCC} No changes may be made beyond this point.
 
-\\\\uselanguage {USenglish}             ${PCC}${PCC}${PCC} This MUST be the last line of the file.
+\\\\uselanguage {USenglish}             ${PCC} This MUST be the last line of the file.
 " >> "$tempfile"
+elif [ "$HYPHENMODE" = "luatex" ] ; then
+    # for luatex we need the closing brace!
+    echo "}" >> "$tempfile"
 fi
 
 # This is atomic.
@@ -809,4 +844,4 @@
     fi
 fi
 
-# vim:set expandtab tabstop=4: #
+# vim:set expandtab tabstop=4 autoindent: #




More information about the Debian-tex-commits mailing list