summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-01-03 04:04:57 +0000
committerNorbert Preining <preining@logic.at>2010-01-03 04:04:57 +0000
commit15f554902e0d3fd0d8ed695458d290e26aa546fd (patch)
tree596338f3493507db5d873762292ac57206d759a7 /Master
parentc8b9592b5c3a39d5a16b028c81d3c340e20d3099 (diff)
support overriding updmap.cfg settings in updmap-local.cfg
git-svn-id: svn://tug.org/texlive/trunk@16583 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl10
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm89
2 files changed, 94 insertions, 5 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 6b2f4091ad3..0d6d7f17b58 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -4977,7 +4977,7 @@ respective files: it recreates them from scratch.
For C<fmtutil> and the language files, this is normal, and both the TeX
Live installer and C<tlmgr> routinely call I<generate> for them.
-For C<updmap>, however, C<tlmgr> use
+For C<updmap>, however, C<tlmgr> does I<not> 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. The I<generate> action only incorporates
@@ -5028,6 +5028,14 @@ The form C<generate language> recreates both the C<language.dat> and the
C<language.def> files, while the forms with extension recreates only
the given language file.
+Special consideration for updmap.cfg: This file allows the setting
+of five switches: dvipsPreferOutline, LW35, dvipsDownloadBase35,
+pdftexDownloadBase14, and dvipdfmDownloadBase14. The defaults for
+these as set in C<updmap-hdr.cfg> are fine for almost all cases. If
+you have the need to change them you can include changed settings to
+these five switches in your C<updmap-local.cfg> file and they will
+be taken over by C<generate updmap>.
+
Options:
=over 4
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 7e87a5c6f9f..aebf0203b80 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -2382,10 +2382,90 @@ sub create_fmtutil {
sub create_updmap {
my ($tlpdb,$dest,$localconf) = @_;
- my @lines = $tlpdb->updmap_cfg_lines(
- get_disabled_local_configs($localconf, '#'));
- _create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest,
- $localconf, 0, '#', \@lines);
+ my @tlpdblines = $tlpdb->updmap_cfg_lines(
+ get_disabled_local_configs($localconf, '#'));
+ # we do not use _create_config_files here because we want to
+ # parse the $localconf file for the five options in updmap.cfg
+ #_create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest,
+ # $localconf, 0, '#', \@tlpdblines);
+ my $headfile = "texmf/web2c/updmap-hdr.cfg";
+ my $root = $tlpdb->root;
+ my @lines;
+ my @localconflines;
+ my %configs;
+ if (-r "$localconf") {
+ #
+ # this should be done more intelligently, but for now only add those
+ # lines without any duplication check ...
+ open FOO, "<$localconf"
+ or die "strange, -r ok but cannot open $localconf: $!";
+ my @bla = <FOO>;
+ close(FOO);
+ for my $l (@bla) {
+ my ($k, $v, @rest) = split(' ', $l);
+ if (check_updmap_config_value($k, $v, $localconf)) {
+ $configs{$k} = $v;
+ } else {
+ push @localconflines, $l;
+ }
+ }
+ }
+ #
+ # read the -hdr file and replace the options if given in the local
+ # config file
+ open(INFILE,"<$root/$headfile") or die("Cannot open $root/$headfile");
+ for my $l (<INFILE>) {
+ my ($k, $v, @rest) = split(' ', $l);
+ if (check_updmap_config_value($k, $v, "$root/$headfile")) {
+ if (defined($configs{$k})) {
+ push @lines, "$k $configs{$k}\n";
+ } else {
+ push @lines, $l;
+ }
+ } else {
+ push @lines, $l;
+ }
+ }
+ close (INFILE);
+
+ # add the lines from the tlpdb
+ push @lines, @tlpdblines;
+
+ # add additional local config lines
+ push @lines, @localconflines;
+
+ if ($#lines >= 0) {
+ open(OUTFILE,">$dest")
+ or die("Cannot open $dest for writing: $!");
+
+ printf OUTFILE "# Generated by %s on %s\n", "$0", scalar localtime;
+ print OUTFILE @lines;
+ close(OUTFILE) || warn "close(>$dest) failed: $!";
+ }
+}
+
+sub check_updmap_config_value {
+ my ($k, $v, $f) = @_;
+ return 0 if !defined($k);
+ return 0 if !defined($v);
+ if (member( $k, qw/dvipsPreferOutline dvipsDownloadBase35
+ pdftexDownloadBase14 dvipdfmDownloadBase14/)) {
+ if ($v eq "true" || $v eq "false") {
+ return 1;
+ } else {
+ tlwarn("Unknown setting for $k in $f: $v\n");
+ return 0;
+ }
+ } elsif ($k eq "LW35") {
+ if (member($v, qw/URW URWkb ADOBE ADOBEkb/)) {
+ return 1;
+ } else {
+ tlwarn("Unknown setting for LW35 in $f: $v\n");
+ return 0;
+ }
+ } else {
+ return 0;
+ }
}
sub create_language_dat {
@@ -2423,6 +2503,7 @@ sub _create_config_files {
open FOO, "<$localconf"
or die "strange, -r ok but cannot open $localconf: $!";
my @tmp = <FOO>;
+ close (FOO);
push @lines, @tmp;
}
if (@postlines) {