diff options
Diffstat (limited to 'Master/install-tl.pl')
-rwxr-xr-x | Master/install-tl.pl | 85 |
1 files changed, 81 insertions, 4 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index e55a2f21932..700893c18f3 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -1069,6 +1069,81 @@ sub install_files { $::localtlpdb->save; } +sub parse_executes_and_create_files { + my %maps; + my %fmtcnffiles; + my %hypcnffiles; + foreach my $p ($::localtlpdb->list_packages) { + my $obj = $tlpdb->get_package ($p); + die "No TeX Live package named $p, strange.\n" if ! $obj; + foreach my $e ($obj->executes) { + if ($e =~ m/addMap (.*)$/) { + $maps{$1} = 1; + } elsif ($e =~ m/addMixedMap (.*)$/) { + $maps{$1} = 2; + } elsif ($e =~ m/BuildFormat (.*)$/) { + $fmtcnffiles{$1} = 1; + } elsif ($e =~ m/BuildLanguageDat (.*)$/) { + $hypcnffiles{$1} = 1; + } else { + die "Unknown execute for package $p: $e\n"; + } + } + } + # + # updmap.cfg -> TEXMFSYSVAR/web2c + `mkdir -p $vars{'TEXMFSYSVAR'}/web2c`; + my $updmapcfgpath = "$vars{'TEXMFSYSVAR'}/web2c/updmap.cfg"; + open(UPDMAPCFG,">$updmapcfgpath") or die("Cannot open $updmapcfgpath for writing!\n"); + foreach (sort keys %maps) { + print UPDMAPCFG "Mixed" if ($maps{$_} == 2); + print UPDMAPCFG "Map $_\n"; + } + close(UPDMAPCFG); + # + # fmtutil.cnf -> TEXMFSYSVAR/web2c + my @formatlines; + foreach my $f (keys %fmtcnffiles) { + open(INFILE,"<$thisdir/texmf/fmtutil/format.$f.cnf") + or die("Cannot open $thisdir/texmf/fmtutil/format.$f.cnf"); + my @tmp = <INFILE>; + close(INFILE); + push @formatlines, @tmp; + } + if ($#formatlines >= 0) { + my $fmtutilpath = "$vars{'TEXMFSYSVAR'}/web2c/fmtutil.cnf"; + open(OUTFILE,">$fmtutilpath") + or die("Cannot open $fmtutilpath for writing!\n"); + foreach (@formatlines) { print OUTFILE; } + close(OUTFILE); + } + # + # hyphenation patterns + my @languagelines = (); + # we first have to add language.us + open(INFILE,"<$thisdir/texmf/tex/generic/config/language.us") + or die("Cannot open $thisdir/texmf/tex/generic/config/language.us"); + my @tmp = <INFILE>; + close(INFILE); + push @languagelines, @tmp; + # now do the other languages + foreach my $f (keys %hypcnffiles) { + open(INFILE,"<$thisdir/texmf/tex/generic/config/language.$f.dat") + or die("Cannot open $thisdir/texmf/tex/generic/config/language.$f.dat"); + my @tmp = <INFILE>; + close(INFILE); + push @languagelines, @tmp; + } + if ($#languagelines >= 0) { + `mkdir -p $vars{'TEXMFSYSVAR'}/tex/generic/config`; + open(OUTFILE, ">$vars{'TEXMFSYSVAR'}/tex/generic/config/language.dat") + or die("Cannot open $vars{'TEXMFSYSVAR'}/tex/generic/config/language.dat for writing"); + foreach (@languagelines) { print OUTFILE; } + close(OUTFILE); + } +} + + load_tlpdb; set_platforms_supported; set_texlive_default_dirs; @@ -1078,10 +1153,12 @@ run_menu; calc_depends; prepare_installation; install_files; -#do_postinstall; -foreach my $k (keys %install) { - print "INSTALL $k\n"; -} +parse_executes_and_create_files; +# +# what more has to be done: +# - create texmf.cnf with right settings +# - create mktex.cnf ??? +# - ??? dump_vars './vars'; $profilepath='.'; |