diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index e30c8d3d95b..696342ecf18 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -733,8 +733,11 @@ sub updmap_cfg_lines { =item C<< $tlpdb->language_dat_lines >> -The function C<language_dat_lines> returns the list of a language.dat file -containing only those hyphenation patterns present in the installation. +The function C<language_dat_lines> returns the concatenation of all +files specified in C<BuildLanguageDat execute> directives in the present +TLPDB. Exception: the result always begins with the contents of +C<language.us> file. This and all the other files are looked for in +C<TLROOT/texmf/tex/generic/config>. =cut sub language_dat_lines { @@ -742,7 +745,7 @@ sub language_dat_lines { my %langfiles; foreach my $p ($self->list_packages) { my $obj = $self->get_package ($p); - die "No TeX Live package named $p, strange.\n" if ! $obj; + die "No TeX Live package named $p, too strange" if ! $obj; foreach my $e ($obj->executes) { if ($e =~ m/BuildLanguageDat (.*)$/) { $langfiles{$1} = 1; @@ -750,20 +753,26 @@ sub language_dat_lines { # others are ignored here } } - my @langlines; - open(LANHDR,"<$self->{'root'}/texmf/tex/generic/config/language.us") - or die("Cannot find $self{'root'}/texmf/tex/generic/config/language.us!\n"); + my @langlines = (); + + # must start with language.us. + local *LANHDR; + $LANHDR = "<$self->{'root'}/texmf/tex/generic/config/language.us"; + open (LANHDR) or die "open($LANHDR) failed: $!"; my @tmp = <LANHDR>; - close(LANHDR); + close (LANHDR); push @langlines, @tmp; + + local *INFILE; foreach my $f (keys %langfiles) { - open(INFILE,"<$self->{'root'}/texmf/tex/generic/config/language.$f.dat") - or die("Cannot open $self->{'root'}/texmf/tex/generic/config/language.$f.cnf"); + $INFILE = "<$self->{'root'}/texmf/tex/generic/config/language.$f.dat"; + open (INFILE) or die "open($INFILE) failed: $!"; @tmp = <INFILE>; - close(INFILE); + close (INFILE); push @langlines, @tmp; } - return(@langlines); + + return @langlines; } |