summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl58
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm28
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm27
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm43
-rw-r--r--Master/tlpkg/etc/dev.allow-disabling-formats-and-maps-in-local-cfg-file.patch231
5 files changed, 115 insertions, 272 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 5728eec155c..fca9a6b8668 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -4347,29 +4347,53 @@ Live installer and C<tlmgr> routinely call I<generate> for them.
For C<updmap>, however, neither the installer nor C<tlmgr> use
C<generate>, because the result would be to disable all maps which have
been manually installed via S<C<updmap-sys --enable>>, e.g., for
-proprietary or local fonts. Only the changes in the C<--localcfg> file
-mentioned below are incorporated by I<generate>. Furthermore, C<tlmgr>
-updates and maintains the final C<updmap.cfg> in C<TEXMFSYSCONFIG> (the
-others use C<TEXMFSYSVAR>) because that is the location that
-C<updmap-sys> (via C<tcfmgr>) uses.
+proprietary or local fonts. The I<generate> action only incorporates
+the changes in the C<--localcfg> file mentioned below. Furthermore,
+C<tlmgr> updates and maintains the final C<updmap.cfg> in
+C<TEXMFSYSCONFIG> (while the other files are in C<TEXMFSYSVAR>), because
+that is the location that C<updmap-sys> (via C<tcfmgr>) uses.
Notwithstanding the above, if you only use the fonts and font packages
-within TeX Live, and maintain your local fonts (if any) with the local
-config file, there is nothing wrong with using C<generate updmap>.
-Indeed, we use it ourselves to generate the C<updmap.cfg> file that is
-maintained in the live source repository.
+within TeX Live, and maintain your local fonts (if any) using
+C<updmap-local.cfg>, there is nothing wrong with using C<generate
+updmap>. Indeed, we use it ourselves to generate the C<updmap.cfg> file
+that is maintained in the live source repository.
In more detail: C<generate> remakes any of the four config files
C<language.dat>, C<language.def>, C<fmtutil.cnf>, and C<updmap.cfg> from
-the information present in the local TLPDB. If the files
-C<language-local.dat>, C<language-local.def>, C<fmtutil-local.cnf>, or
-C<updmap-local.cfg> are present under C<TEXMFLOCAL> in the respective
-directories, their contents will be simply merged into the final files,
-with no error checking of any kind.
+the information present in the local TLPDB, plus locally-maintained
+files.
+
+The locally-maintained files are C<language-local.dat>,
+C<language-local.def>, C<fmtutil-local.cnf>, or C<updmap-local.cfg>,
+searched for in C<TEXMFLOCAL> in the respective directories. If they
+are present, the final file is made by starting with the main file,
+omitting any entries that the local file specifies to be disabled, and
+finally appending the local file.
+
+Local files specify entries to be disabled with a comment line like this:
+
+ #!NAME
+ %!NAME
+
+where C<fmtutil.cnf> and C<updmap.cfg> use C<#>, and C<language.dat> and
+C<language.def> use C<%>. In any case, the I<name> is the respective
+format name, map file name (include the C<.map> extension),or
+hyphenation pattern identifier. Examples:
+
+ #!pdflatex
+ #!lm.map
+ %!german
+
+(Of course, you're not likely to actually want to disable those
+particular items. They're just examples.)
+
+After such a disabling line, the local file can include another entry
+for the same item, if a different definition is desired.
The form C<generate language> recreates both the C<language.dat> and the
-C<language.def> files, while the forms with extension only recreates
-the given file.
+C<language.def> files, while the forms with extension recreates only
+the given language file.
Options:
@@ -4423,7 +4447,7 @@ Currently this option only applies to the L<update|/"update
"end-of-updates"
other output from post actions, not in machine readable form
-The header section current has two fields: C<location-url> (the
+The header section currently has two fields: C<location-url> (the
repository source from which updates are being drawn), and
C<total-bytes> (the total number of bytes to be downloaded).
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index fabb05332b7..b069bae9d3c 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -1,6 +1,6 @@
# $Id$
# TeXLive::TLPDB.pm - module for using tlpdb files
-# Copyright 2007, 2008 Norbert Preining
+# Copyright 2007, 2008, 2009 Norbert Preining
#
# This file is licensed under the GNU General Public License version 2
# or any later version.
@@ -1221,6 +1221,9 @@ sub format_definitions {
The function C<fmtutil_cnf_lines> returns the list of a fmtutil.cnf file
containing only those formats present in the installation.
+Every format listed in the tlpdb but listed in the arguments
+will not be included in the list of lines returned.
+
=cut
sub fmtutil_cnf_lines {
my $self = shift;
@@ -1228,16 +1231,19 @@ sub fmtutil_cnf_lines {
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
die "$0: No TeX Live package named $p, strange" if ! $obj;
- push @lines, $obj->fmtutil_cnf_lines;
+ push @lines, $obj->fmtutil_cnf_lines(@_);
}
return(@lines);
}
-=item C<< $tlpdb->updmap_cfg_lines >>
+=item C<< $tlpdb->updmap_cfg_lines ( [@disabled_maps] ) >>
The function C<updmap_cfg_lines> returns the list of a updmap.cfg file
containing only those maps present in the installation.
+A map file mentioned in the tlpdb but listed in the arguments will not
+be included in the list of lines returned.
+
=cut
sub updmap_cfg_lines {
my $self = shift;
@@ -1245,16 +1251,19 @@ sub updmap_cfg_lines {
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
die "$0: No TeX Live package named $p, strange" if ! $obj;
- push @lines, $obj->updmap_cfg_lines;
+ push @lines, $obj->updmap_cfg_lines(@_);
}
return(@lines);
}
-=item C<< $tlpdb->language_dat_lines >>
+=item C<< $tlpdb->language_dat_lines ( [@disabled_hyphen_names] )>>
The function C<language_dat_lines> returns the list of all
lines for language.dat that can be generated from the tlpdb.
+Every hyphenation pattern listed in the tlpdb but listed in the arguments
+will not be included in the list of lines returned.
+
=cut
sub language_dat_lines {
@@ -1263,16 +1272,19 @@ sub language_dat_lines {
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
die "$0: No TeX Live package named $p, strange" if ! $obj;
- push @lines, $obj->language_dat_lines;
+ push @lines, $obj->language_dat_lines(@_);
}
return(@lines);
}
-=item C<< $tlpdb->language_def_lines >>
+=item C<< $tlpdb->language_def_lines ( [@disabled_hyphen_names] )>>
The function C<language_def_lines> returns the list of all
lines for language.def that can be generated from the tlpdb.
+Every hyphenation pattern listed in the tlpdb but listed in the arguments
+will not be included in the list of lines returned.
+
=cut
sub language_def_lines {
@@ -1281,7 +1293,7 @@ sub language_def_lines {
foreach my $p ($self->list_packages) {
my $obj = $self->get_package ($p);
die "$0: No TeX Live package named $p, strange" if ! $obj;
- push @lines, $obj->language_def_lines;
+ push @lines, $obj->language_def_lines(@_);
}
return(@lines);
}
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index a2a17e257b3..b05366dff24 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -938,6 +938,7 @@ sub format_definitions {
#
sub fmtutil_cnf_lines {
my $obj = shift;
+ my @disabled = @_;
my @fmtlines = ();
my $first = 1;
my $pkg = $obj->name;
@@ -952,6 +953,7 @@ sub fmtutil_cnf_lines {
$first = 0;
}
my $mode = ($r{"mode"} ? "" : "#! ");
+ $mode = "#! " if TeXLive::TLUtils::member ($r{'name'}, @disabled);
push @fmtlines, "$mode$r{'name'} $r{'engine'} $r{'patterns'} $r{'options'}\n";
}
}
@@ -961,6 +963,7 @@ sub fmtutil_cnf_lines {
sub updmap_cfg_lines {
my $obj = shift;
+ my @disabled = @_;
my %maps;
foreach my $e ($obj->executes) {
if ($e =~ m/addMap (.*)$/) {
@@ -972,6 +975,7 @@ sub updmap_cfg_lines {
}
my @updmaplines;
foreach (sort keys %maps) {
+ next if TeXLive::TLUtils::member($_, @disabled);
if ($maps{$_} == 2) {
push @updmaplines, "MixedMap $_\n";
} else {
@@ -983,24 +987,33 @@ sub updmap_cfg_lines {
sub language_dat_lines {
+ my $self = shift;
+ local @disabled = @_; # we use @disabled in the nested sub
+ my @lines = $self->_parse_hyphen_execute(\&make_dat_lines);
+ return @lines;
+
sub make_dat_lines {
my ($name, $lhm, $rhm, $file, @syn) = @_;
my @ret;
+ return if TeXLive::TLUtils::member($name, @disabled);
push @ret, "$name $file\n";
foreach (@syn) {
push @ret, "=$_\n";
}
- return(@ret);
+ return @ret;
}
- my $self = shift;
- my @lines = $self->_parse_hyphen_execute(\&make_dat_lines);
- return(@lines);
}
sub language_def_lines {
+ my $self = shift;
+ local @disabled = @_; # we use @disabled in the nested sub
+ my @lines = $self->_parse_hyphen_execute(\&make_def_lines);
+ return @lines;
+
sub make_def_lines {
my ($name, $lhm, $rhm, $file, @syn) = @_;
+ return if TeXLive::TLUtils::member($name, @disabled);
my $exc = "";
my @ret;
push @ret, "\\addlanguage\{$name\}\{$file\}\{$exc\}\{$lhm\}\{$rhm\}\n";
@@ -1009,15 +1022,11 @@ sub language_def_lines {
push @ret, "\\addlanguage\{$_\}\{$file\}\{$exc\}\{$lhm\}\{$rhm\}\n";
#debug("Ignoring synonym $_ for $name when creating language.def\n");
}
- return(@ret);
+ return @ret;
}
- my $self = shift;
- my @lines = $self->_parse_hyphen_execute(\&make_def_lines);
- return(@lines);
}
-
sub _parse_hyphen_execute {
my ($obj, $coderef) = @_;
my @langlines = ();
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 01350f641aa..5a9568f0a1b 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2291,36 +2291,65 @@ C<$TEXMFSYSVAR>). These functions merge the information present in the
TLPDB C<$tlpdb> (formats, maps, hyphenations) with local configuration
additions: C<$localconf>.
-Currently the "merging" is done trivially by appending the content of
-the local configuration files at the end of the file. This should be
-improved (checking for duplicates).
+Currently the merging is done by omitting disabled entries specified
+in the local file, and then appending the content of the local
+configuration files at the end of the file. We should also check for
+duplicates, maybe even error checking.
=cut
+#
+# get_disabled_local_configs
+# returns the list of disabled formats/hyphenpatterns/maps
+# disabling is done by putting
+# #!NAME
+# or
+# %!NAME
+# into the respective foo-local.cnf/cfg file
+#
+sub get_disabled_local_configs {
+ my $localconf = shift;
+ my $cc = shift;
+ if (-r "$localconf") {
+ open FOO, "<$localconf"
+ or die "strange, -r ok but cannot open $localconf: $!";
+ my @tmp = <FOO>;
+ close(FOO) || warn("Closing $localconf did not succeed: $!");
+ my @disabled = map { if (m/^$cc!(\S+)\s*$/) { $1 } else { }} @tmp;
+ return @disabled;
+ }
+}
+
sub create_fmtutil {
my ($tlpdb,$dest,$localconf) = @_;
- my @lines = $tlpdb->fmtutil_cnf_lines;
+ my @lines = $tlpdb->fmtutil_cnf_lines(
+ get_disabled_local_configs($localconf, '#'));
_create_config_files($tlpdb, "texmf/web2c/fmtutil-hdr.cnf", $dest,
$localconf, 0, '#', \@lines);
}
sub create_updmap {
my ($tlpdb,$dest,$localconf) = @_;
- my @lines = $tlpdb->updmap_cfg_lines;
+ my @lines = $tlpdb->updmap_cfg_lines(
+ get_disabled_local_configs($localconf, '#'));
_create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest,
$localconf, 0, '#', \@lines);
}
sub create_language_dat {
my ($tlpdb,$dest,$localconf) = @_;
- my @lines = $tlpdb->language_dat_lines;
+ # no checking for disabled stuff for language.dat and .def
+ my @lines = $tlpdb->language_dat_lines(
+ get_disabled_local_configs($localconf, '%'));
_create_config_files($tlpdb, "texmf/tex/generic/config/language.us", $dest,
$localconf, 0, '%', \@lines);
}
sub create_language_def {
my ($tlpdb,$dest,$localconf) = @_;
- my @lines = $tlpdb->language_def_lines;
+ # no checking for disabled stuff for language.dat and .def
+ my @lines = $tlpdb->language_def_lines(
+ get_disabled_local_configs($localconf, '%'));
my @postlines;
push @postlines, "%%% No changes may be made beyond this point.\n";
push @postlines, "\n";
diff --git a/Master/tlpkg/etc/dev.allow-disabling-formats-and-maps-in-local-cfg-file.patch b/Master/tlpkg/etc/dev.allow-disabling-formats-and-maps-in-local-cfg-file.patch
deleted file mode 100644
index ea770c0ea13..00000000000
--- a/Master/tlpkg/etc/dev.allow-disabling-formats-and-maps-in-local-cfg-file.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-Index: tlpkg/TeXLive/TLPDB.pm
-===================================================================
---- tlpkg/TeXLive/TLPDB.pm (revision 14688)
-+++ tlpkg/TeXLive/TLPDB.pm (working copy)
-@@ -1221,6 +1221,9 @@
- The function C<fmtutil_cnf_lines> returns the list of a fmtutil.cnf file
- containing only those formats present in the installation.
-
-+Every format listed in the tlpdb but listed in the arguments
-+will not be included in the list of lines returned.
-+
- =cut
- sub fmtutil_cnf_lines {
- my $self = shift;
-@@ -1228,16 +1231,19 @@
- foreach my $p ($self->list_packages) {
- my $obj = $self->get_package ($p);
- die "$0: No TeX Live package named $p, strange" if ! $obj;
-- push @lines, $obj->fmtutil_cnf_lines;
-+ push @lines, $obj->fmtutil_cnf_lines(@_);
- }
- return(@lines);
- }
-
--=item C<< $tlpdb->updmap_cfg_lines >>
-+=item C<< $tlpdb->updmap_cfg_lines ( [@disabled_maps] ) >>
-
- The function C<updmap_cfg_lines> returns the list of a updmap.cfg file
- containing only those maps present in the installation.
-
-+A map file mentioned in the tlpdb but listed in the arguments will not
-+be included in the list of lines returned.
-+
- =cut
- sub updmap_cfg_lines {
- my $self = shift;
-@@ -1245,16 +1251,19 @@
- foreach my $p ($self->list_packages) {
- my $obj = $self->get_package ($p);
- die "$0: No TeX Live package named $p, strange" if ! $obj;
-- push @lines, $obj->updmap_cfg_lines;
-+ push @lines, $obj->updmap_cfg_lines(@_);
- }
- return(@lines);
- }
-
--=item C<< $tlpdb->language_dat_lines >>
-+=item C<< $tlpdb->language_dat_lines ( [@disabled_hyphen_names] )>>
-
- The function C<language_dat_lines> returns the list of all
- lines for language.dat that can be generated from the tlpdb.
-
-+Every hyphenation pattern listed in the tlpdb but listed in the arguments
-+will not be included in the list of lines returned.
-+
- =cut
-
- sub language_dat_lines {
-@@ -1263,16 +1272,19 @@
- foreach my $p ($self->list_packages) {
- my $obj = $self->get_package ($p);
- die "$0: No TeX Live package named $p, strange" if ! $obj;
-- push @lines, $obj->language_dat_lines;
-+ push @lines, $obj->language_dat_lines(@_);
- }
- return(@lines);
- }
-
--=item C<< $tlpdb->language_def_lines >>
-+=item C<< $tlpdb->language_def_lines ( [@disabled_hyphen_names] )>>
-
- The function C<language_def_lines> returns the list of all
- lines for language.def that can be generated from the tlpdb.
-
-+Every hyphenation pattern listed in the tlpdb but listed in the arguments
-+will not be included in the list of lines returned.
-+
- =cut
-
- sub language_def_lines {
-@@ -1281,7 +1293,7 @@
- foreach my $p ($self->list_packages) {
- my $obj = $self->get_package ($p);
- die "$0: No TeX Live package named $p, strange" if ! $obj;
-- push @lines, $obj->language_def_lines;
-+ push @lines, $obj->language_def_lines(@_);
- }
- return(@lines);
- }
-Index: tlpkg/TeXLive/TLPOBJ.pm
-===================================================================
---- tlpkg/TeXLive/TLPOBJ.pm (revision 14688)
-+++ tlpkg/TeXLive/TLPOBJ.pm (working copy)
-@@ -938,6 +938,7 @@
- #
- sub fmtutil_cnf_lines {
- my $obj = shift;
-+ my @disabled = @_;
- my @fmtlines = ();
- my $first = 1;
- my $pkg = $obj->name;
-@@ -952,6 +953,7 @@
- $first = 0;
- }
- my $mode = ($r{"mode"} ? "" : "#! ");
-+ $mode = "#! " if TeXLive::TLUtils::member ($r{'name'}, @disabled);
- push @fmtlines, "$mode$r{'name'} $r{'engine'} $r{'patterns'} $r{'options'}\n";
- }
- }
-@@ -961,6 +963,7 @@
-
- sub updmap_cfg_lines {
- my $obj = shift;
-+ my @disabled = @_;
- my %maps;
- foreach my $e ($obj->executes) {
- if ($e =~ m/addMap (.*)$/) {
-@@ -972,6 +975,7 @@
- }
- my @updmaplines;
- foreach (sort keys %maps) {
-+ next if TeXLive::TLUtils::member($_, @disabled);
- if ($maps{$_} == 2) {
- push @updmaplines, "MixedMap $_\n";
- } else {
-@@ -983,24 +987,29 @@
-
-
- sub language_dat_lines {
-+ my $self = shift;
-+ local @disabled = @_;
- sub make_dat_lines {
- my ($name, $lhm, $rhm, $file, @syn) = @_;
- my @ret;
-+ return if TeXLive::TLUtils::member($name, @disabled);
- push @ret, "$name $file\n";
- foreach (@syn) {
- push @ret, "=$_\n";
- }
- return(@ret);
- }
-- my $self = shift;
- my @lines = $self->_parse_hyphen_execute(\&make_dat_lines);
- return(@lines);
- }
-
-
- sub language_def_lines {
-+ my $self = shift;
-+ local @disabled = @_;
- sub make_def_lines {
- my ($name, $lhm, $rhm, $file, @syn) = @_;
-+ return if TeXLive::TLUtils::member($name, @disabled);
- my $exc = "";
- my @ret;
- push @ret, "\\addlanguage\{$name\}\{$file\}\{$exc\}\{$lhm\}\{$rhm\}\n";
-@@ -1011,7 +1020,6 @@
- }
- return(@ret);
- }
-- my $self = shift;
- my @lines = $self->_parse_hyphen_execute(\&make_def_lines);
- return(@lines);
- }
-Index: tlpkg/TeXLive/TLUtils.pm
-===================================================================
---- tlpkg/TeXLive/TLUtils.pm (revision 14688)
-+++ tlpkg/TeXLive/TLUtils.pm (working copy)
-@@ -2297,30 +2297,58 @@
-
- =cut
-
-+#
-+# get_disabled_local_configs
-+# returns the list of disabled formats/hyphenpatterns/maps
-+# disabling is done by putting
-+# #!NAME
-+# or
-+# %!NAME
-+# into the respective XXXX-local.cnf/cfg file
-+#
-+sub get_disabled_local_configs {
-+ my $localconf = shift;
-+ my $cc = shift;
-+ if (-r "$localconf") {
-+ open FOO, "<$localconf"
-+ or die "strange, -r ok but cannot open $localconf: $!";
-+ my @tmp = <FOO>;
-+ close(FOO) || warn("Closing $localconf did not succeed: $!");
-+ my @disabled = map { if (m/^$cc!(\S+)\s*$/) { $1 } else { }} @tmp;
-+ return @disabled;
-+ }
-+}
-+
- sub create_fmtutil {
- my ($tlpdb,$dest,$localconf) = @_;
-- my @lines = $tlpdb->fmtutil_cnf_lines;
-+ my @lines = $tlpdb->fmtutil_cnf_lines(
-+ get_disabled_local_configs($localconf, '#'));
- _create_config_files($tlpdb, "texmf/web2c/fmtutil-hdr.cnf", $dest,
- $localconf, 0, '#', \@lines);
- }
-
- sub create_updmap {
- my ($tlpdb,$dest,$localconf) = @_;
-- my @lines = $tlpdb->updmap_cfg_lines;
-+ my @lines = $tlpdb->updmap_cfg_lines(
-+ get_disabled_local_configs($localconf, '#'));
- _create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest,
- $localconf, 0, '#', \@lines);
- }
-
- sub create_language_dat {
- my ($tlpdb,$dest,$localconf) = @_;
-- my @lines = $tlpdb->language_dat_lines;
-+ # no checking for disabled stuff for language.dat and .def
-+ my @lines = $tlpdb->language_dat_lines(
-+ get_disabled_local_configs($localconf, '%'));
- _create_config_files($tlpdb, "texmf/tex/generic/config/language.us", $dest,
- $localconf, 0, '%', \@lines);
- }
-
- sub create_language_def {
- my ($tlpdb,$dest,$localconf) = @_;
-- my @lines = $tlpdb->language_def_lines;
-+ # no checking for disabled stuff for language.dat and .def
-+ my @lines = $tlpdb->language_def_lines(
-+ get_disabled_local_configs($localconf, '%'));
- my @postlines;
- push @postlines, "%%% No changes may be made beyond this point.\n";
- push @postlines, "\n";