diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 67 |
1 files changed, 5 insertions, 62 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index a385b6b2d62..12e7c8a4ce2 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2681,67 +2681,10 @@ sub create_fmtutil { } sub create_updmap { - my ($tlpdb,$dest,$localconf) = @_; - 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: $!"; - } + my ($tlpdb,$dest) = @_; + my @tlpdblines = $tlpdb->updmap_cfg_lines(); + _create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest, + undef, 0, '#', \@tlpdblines); } sub check_updmap_config_value { @@ -2809,7 +2752,7 @@ sub _create_config_files { my @lines = <INFILE>; push @lines, @$tlpdblinesref; close (INFILE); - if (-r "$localconf") { + if (defined($localconf) && -r $localconf) { # # this should be done more intelligently, but for now only add those # lines without any duplication check ... |