[Debian-tex-commits] SVN tex-common commit + diffs: r3912 - in tex-common/branches/for-tl2008: debian scripts
Norbert Preining
preining at alioth.debian.org
Sun May 10 14:05:59 UTC 2009
Author: preining
Date: 2009-05-10 14:05:59 +0000 (Sun, 10 May 2009)
New Revision: 3912
Added:
tex-common/branches/for-tl2008/scripts/update-language-dat
tex-common/branches/for-tl2008/scripts/update-language-def
Modified:
tex-common/branches/for-tl2008/debian/changelog
tex-common/branches/for-tl2008/debian/tex-common.links
tex-common/branches/for-tl2008/scripts/dh_installtex
tex-common/branches/for-tl2008/scripts/update-fontlang
Log:
experimental support for language.def
Modified: tex-common/branches/for-tl2008/debian/changelog
===================================================================
--- tex-common/branches/for-tl2008/debian/changelog 2009-05-10 13:38:40 UTC (rev 3911)
+++ tex-common/branches/for-tl2008/debian/changelog 2009-05-10 14:05:59 UTC (rev 3912)
@@ -1,3 +1,15 @@
+tex-common (2.00) experimental; urgency=low
+
+ * new experimental branch for changes necessary to support TeX Live 2008
+ and later that introduced hyphenation pattern support for etex based
+ formats. language.def is not managed like language.dat.
+ - add support for generating language.def to update-fontlang
+ - install those scripts as update-language-def and update-language-dat
+ - make update-language work as calling both of the above
+ - adjust dh_installtex to accept new syntax
+
+ -- Norbert Preining <preining at debian.org> Sun, 10 May 2009 16:03:38 +0200
+
tex-common (1.18) unstable; urgency=low
* make sure that fmtutil-sys --all and updmap-sys are called on new
Modified: tex-common/branches/for-tl2008/debian/tex-common.links
===================================================================
--- tex-common/branches/for-tl2008/debian/tex-common.links 2009-05-10 13:38:40 UTC (rev 3911)
+++ tex-common/branches/for-tl2008/debian/tex-common.links 2009-05-10 14:05:59 UTC (rev 3912)
@@ -1,12 +1,18 @@
usr/share/man/man1/update-fontlang.1 usr/share/man/man1/update-updmap.1
usr/share/man/man1/update-fontlang.1 usr/share/man/man1/update-fmtutil.1
usr/share/man/man1/update-fontlang.1 usr/share/man/man1/update-language.1
+usr/share/man/man1/update-fontlang.1 usr/share/man/man1/update-language-def.1
+usr/share/man/man1/update-fontlang.1 usr/share/man/man1/update-language-dat.1
usr/bin/update-fontlang usr/bin/update-updmap
usr/bin/update-fontlang usr/bin/update-fmtutil
usr/bin/update-fontlang usr/bin/update-language
+usr/bin/update-fontlang usr/bin/update-language-def
+usr/bin/update-fontlang usr/bin/update-language-dat
usr/bin/update-fontlang usr/sbin/update-updmap
usr/bin/update-fontlang usr/sbin/update-fmtutil
usr/bin/update-fontlang usr/sbin/update-language
+usr/bin/update-fontlang usr/sbin/update-language-def
+usr/bin/update-fontlang usr/sbin/update-language-dat
etc/texmf/texmf.cnf usr/share/texmf/web2c/texmf.cnf
var/lib/texmf/ls-R-TEXMFMAIN usr/share/texmf/ls-R
usr/share/doc/texmf usr/share/texmf/doc
Modified: tex-common/branches/for-tl2008/scripts/dh_installtex
===================================================================
--- tex-common/branches/for-tl2008/scripts/dh_installtex 2009-05-10 13:38:40 UTC (rev 3911)
+++ tex-common/branches/for-tl2008/scripts/dh_installtex 2009-05-10 14:05:59 UTC (rev 3912)
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# dh_installtex --- register Type 1 fonts, languages, or formats with TeX
# Copyright (C) 2006, 2007 Florent Rougon
-# Copyright (C) 2006, 2007, 2008 Norbert Preining
+# Copyright (C) 2006, 2007, 2008, 2009 Norbert Preining
# Copyright (C) 2006, 2007 Frank Küster
#
# This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
=head1 NAME
-dh_installtex - register Type 1 fonts, languages, or formats with TeX
+dh_installtex - register Type 1 fonts, hyphenation patterns, or formats with TeX
=cut
@@ -38,8 +38,8 @@
[B<map=MixedMap,>I<file.map>]
[B<map=Map,>I<file.map>]
[B<mapfile=>I<file.cfg>[=I<n>]]
-[B<language=>I<lang>,I<pattern>[,I<alternate>,...]]
-[B<languagefile=>I<file.cnf>[=I<n>]]
+[B<hyphen=>I<lang>,I<file>[,lhm=I<n>][,rhm=I<n>][,synonym=I<syn>,...]]
+[B<hyphenfile=>I<file.cnf>[=I<n>]]
[B<format=>I<format>,I<engine>,I<hyphenfile>,I<rest args>]
[B<formatfile=>I<file.cnf>[=I<n>]]
[B<texmftrees=>I<tree>[,I<tree>]]
@@ -90,9 +90,9 @@
1) B<Pre made config files:> These files can be specified with the
different I<type>file= options, together with an optional priority.
-I<type> can be one of map, format and language, and these files will be
+I<type> can be one of map, format and hyphen, and these files will be
installed into /etc/texmf/I<configdir>/ for the respective type (updmap.d for
-map files, language.d for language files, and fmt.d for format files).
+map files, hyphen.d for hyphenation pattern files, and fmt.d for format files).
Example:
@@ -103,25 +103,24 @@
2) B<Directly on the cmd line:>
-You can specify maps, formats, and languages on the cmd line. The items
+You can specify maps, formats, and hyphenations on the cmd line. The items
are stored in the respective config file 20package
Example:
- dh_installtex map=Map,foo.map language=greek,grphyph4.tex,polygreek
+ dh_installtex map=Map,foo.map hyphen=french,loadhyph-fr.tex,lhm=2,rhm=3,synonym=patois,synonym=francais
would install a file /etc/texmf/updmap.d/20package.cfg containing the line
Map foo.map
-and a file /etc/texmf/language.d/20package.cnf containing the lines
+and a file /etc/texmf/hyphen.d/20package.cnf containing the lines
- greek grphyph4.tex
- =polygreek
+ name=french file=loadhyphen-fr.tex lefthyphenmin=2 righthyphenmin=3 synonyms=patois,francais
3) B<Package files:>
You create a file debian/package.maps or debian/maps,
-debian/package.languages or debian/languages,
+debian/package.hyphens or debian/hyphens,
debian/package.formats or debian/formats. These files are
installed with default priority and the name of the package. Each of these
files will be installed into the first package dh_installtex
@@ -140,7 +139,7 @@
=head2 Mixing the different variants
The command line items (Variant 2) are merged into the debian/package.maps
-(debian/package.languages, debian/package.formats)
+(debian/package.hyphens, debian/package.formats)
file and the merged file is installed as 20package.cfg/cnf. If you specify
an additional package.cfg/cnf (Variant 1) without a different priority than
the default one on the cmd line, this will raise an error since both files
@@ -252,27 +251,27 @@
#
# extension of package files debian/$package.formats and/or debian/formats etc
my %pkgfileext = (
- language => "languages",
+ hyphen => "hyphens",
format => "formats",
map => "maps" );
# extension of the config files
my %configfileext = (
- language => "cnf",
+ hyphen => "cnf",
format => "cnf",
map => "cfg" );
# comment char for magic header
my %commentchar = (
- language => '%',
+ hyphen => '%',
format => '#',
map => '#' );
# directory under /etc/texmf/ where files are installed
my %configdir = (
- language => "language.d",
+ hyphen => "hyphen.d",
format => "fmt.d",
map => "updmap.d" );
# directory under /var/lib/tex-common where list files are installed
my %managedir = (
- language => "language-cnf",
+ hyphen => "hyphen-cnf",
format => "fmtutil-cnf",
map => "fontmap-cfg" );
#
@@ -309,7 +308,8 @@
if ($m = extract_map($entry, $mapdoconfig)) { push @$dataref, $m; }
} elsif ($type eq "format") {
if ($m = extract_format($entry)) { push @$dataref, $m; }
- }
+ }
+ # TODO should we do something with hypehn here!????
}
sub extract_format {
@@ -347,12 +347,29 @@
my ($format,$engine,$pat, at rest) = split(",",$line);
my $ret = "$format\t$engine\t$pat\t" . join(",", at rest);
return($ret);
- } elsif ($type eq "language") {
+ } elsif ($type eq "hyphen") {
my ($lang,$pat, at rest) = split(",",$line);
- my $ret="$lang $pat\n";
+ my $ret="name=$lang file=$pat\n";
+ my @synonyms = ();
+ my $lhm;
+ my $rhm;
foreach (@rest) {
- $ret .= "=$_\n";
+ my ($a,$b) = split("=", $_, 2);
+ if ($a eq "lhm") {
+ $lhm = $b;
+ } elsif ($a eq "rhm") {
+ $rhm = $b;
+ } elsif ($a eq "synonym") {
+ push @synonyms, $b;
+ } else {
+ error("$line is not well formed.");
+ }
}
+ $ret .= " lefthyphenmin=$lhm" if defined($lhm);
+ $ret .= " righthyphenmin=$rhm" if defined($rhm);
+ if ($#synonyms >= 0) {
+ $ret .= " synonyms=" . join(".", at synonyms);
+ }
return($ret);
}
}
@@ -381,7 +398,7 @@
#
foreach (@ARGV) {
if ((m/^(map)file=(.*\.cfg)(=([[:digit:]]+))?$/) ||
- (m/^(language)file=(.*\.cnf)(=([[:digit:]]+))?$/) ||
+ (m/^(hyphen)file=(.*\.cnf)(=([[:digit:]]+))?$/) ||
(m/^(format)file=(.*\.cnf)(=([[:digit:]]+))?$/)) {
my $type=$1;
my $fn=$2;
@@ -390,7 +407,7 @@
$pr=$4;
}
$cmdlinefilespriority{$type}{$fn}=$pr;
- } elsif (m/^(map|language|format)=(.*)$/) {
+ } elsif (m/^(map|hyphen|format)=(.*)$/) {
push @{$cmdlineargs{$1}}, $2;
} elsif (m/^texmftrees=(.*)$/) {
@cmdlinetexmftrees = split /,/, $1;
@@ -439,7 +456,7 @@
%cmdlineargs = ();
}
- foreach my $type ("map", "language", "format") {
+ foreach my $type ("map", "hyphen", "format") {
my @cmdlineconfigfiles = ();
my @cmdlinearguments = ();
my $pkgprovidedfile = 0;
Modified: tex-common/branches/for-tl2008/scripts/update-fontlang
===================================================================
--- tex-common/branches/for-tl2008/scripts/update-fontlang 2009-05-10 13:38:40 UTC (rev 3911)
+++ tex-common/branches/for-tl2008/scripts/update-fontlang 2009-05-10 14:05:59 UTC (rev 3912)
@@ -4,7 +4,7 @@
# from a set of files
# Copyright (C) 2002 Atsuhito Kohda
# Copyright (C) 2004, 2005, 2006, 2007 Florent Rougon
-# Copyright (C) 2005, 2006 Norbert Preining
+# Copyright (C) 2005, 2006, 2009 Norbert Preining
# Copyright (C) 2007 Frank Küster
#
# This program is free software; you can redistribute it and/or modify
@@ -26,12 +26,35 @@
SYSPATH_BASE=/var/lib/texmf
+HYPHENMODE=nohyphen
+
if [ "$progname" = "update-language" ] ; then
- CNFDIR=language.d
+ update-language-dat
+ update-language-def
+ exit 0
+elif [ "$progname" = "update-language-def" ] ; then
+ CNFDIR=hyphen.d
+ HYPHENMODE=etex
# 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.def
+ SYSWIDE_DEFAULT_OUTPUTFILE="$SYSWIDE_VARD/$DEFAULT_OUTPUTFILE_BASENAME"
+ CC="%" # for COMMENTCHAR
+ # 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
+ HYPHENMODE=latex
+ # System-wide configuration directory
+ SYSWIDE_CONFDIR=/etc/texmf/$CNFDIR
+ CHECKFILE="$SYSWIDE_CONFDIR/00tex.cnf"
+ EXT="cnf"
MEMORY_DIR=/var/lib/tex-common/language-cnf
PATH_COMPONENT=tex/generic/config
SYSWIDE_VARD="$SYSPATH_BASE/$PATH_COMPONENT"
@@ -106,14 +129,82 @@
exit $rc
}
+do_one_hyphen_line()
+{
+ line="$1"
+ case "$line" in
+ ${CC}*) echo "$line" >> "$tempfile" ; return ;;
+ esac
+ set -- $line
+ name=""
+ lhm=""
+ rhm=""
+ synonyms=""
+ f=""
+ while [ ! "$1" = "" ] ; do
+ case "$1" in
+ name=*) name="${1/#name=/}" ;;
+ lefthyphenmin=*) lhm="${1/#lefthyphenmin=/}" ;;
+ righthyphenmin=*) rhm="${1/#righthyphenmin=/}" ;;
+ synonyms=*) synonyms="${1/#synonyms=/}" ;;
+ file=*) f="${1/#file=/}" ;;
+ *) echo "Unknown AddHypen directive ==$line==!" >&2 ; return ;;
+ esac
+ shift
+ done
+ if [ "$name$lhm$rhm$synonyms$f" = "" ] ; then
+ return
+ fi
+ if [ ! "$lhm$rhm$synonyms$f" = "" ] ; 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 [ "$f" = "" ] ; then
+ echo "the line $line does not contain a file= directive, ignored!" >&2
+ return
+ fi
+ fi
+ if [ "$HYPHENMODE" = "etex" ] ; then
+ echo "\\addlanguage{$name}{$f}{}{$lhm}{$rhm}" >> "$tempfile"
+ else
+ echo "$name $f" >> "$tempfile"
+ fi
+ if [ ! "$synonyms" = "" ] ; then
+ {
+ IFS=",$IFS"
+ for s in $synonyms ; do
+ if [ "$HYPHENMODE" = "etex" ] ; then
+ echo "\\addlanguage{$s}{$f}{}{$lhm}{$rhm}" >> "$tempfile"
+ else
+ echo "=$s" >> "$tempfile"
+ fi
+ done
+ }
+ fi
+}
+include_hyphen_file_core()
+{
+ file="$1"
+ cat "$1" | while read line ; do
+ do_one_hyphen_line "$line"
+ done
+}
+
# include_file <file path>
include_file()
{
file="$1"
printf "\n${PCC}${PCC}${PCC} From file: $file\n" >>"$tempfile"
- cat "$file" >>"$tempfile"
+ if [ $HYPHENMODE = "nohyphen" ] ; then
+ cat "$file" >>"$tempfile"
+ else
+ include_hyphen_file_core "$file"
+ fi
echo "${CC}${CC}${CC} End of file: $file" >>"$tempfile"
case "$file" in
*/10texlive-latex-base.cnf)
Added: tex-common/branches/for-tl2008/scripts/update-language-dat
===================================================================
--- tex-common/branches/for-tl2008/scripts/update-language-dat (rev 0)
+++ tex-common/branches/for-tl2008/scripts/update-language-dat 2009-05-10 14:05:59 UTC (rev 3912)
@@ -0,0 +1 @@
+link update-fontlang
\ No newline at end of file
Property changes on: tex-common/branches/for-tl2008/scripts/update-language-dat
___________________________________________________________________
Added: svn:special
+ *
Added: tex-common/branches/for-tl2008/scripts/update-language-def
===================================================================
--- tex-common/branches/for-tl2008/scripts/update-language-def (rev 0)
+++ tex-common/branches/for-tl2008/scripts/update-language-def 2009-05-10 14:05:59 UTC (rev 3912)
@@ -0,0 +1 @@
+link update-fontlang
\ No newline at end of file
Property changes on: tex-common/branches/for-tl2008/scripts/update-language-def
___________________________________________________________________
Added: svn:special
+ *
More information about the Debian-tex-commits
mailing list