summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-12-03 15:35:04 +0000
committerNorbert Preining <preining@logic.at>2007-12-03 15:35:04 +0000
commit9966918975f7791e33a9a6e8064a5553fa6955a6 (patch)
tree3ec4694e2af0f28897b072d64a8cbdc590c1ea98 /Master/tlpkg/TeXLive
parent8769358c65a1821de408076b69cf94f3ce2073a4 (diff)
move the create_(fmtutil|updmap|language) to TLUtils, document them,
and use them in instll-tl.pl. We will need them anyway in the updater. git-svn-id: svn://tug.org/texlive/trunk@5698 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm96
1 files changed, 96 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index ef33018308e..8dac6d9f6cf 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -50,6 +50,9 @@ C<TeXLive::TLUtils> -- Utilities used in the TeX Live Infrastructure Modules
TeXLive::TLUtils::additional_architectures_available_from_net;
TeXLive::TLUtils::make_var_skeleton($path);
TeXLive::TLUtils::make_local_skeleton($path);
+ TeXLive::TLUtils::create_fmtutil($tlpdb,$texmfsysvar,$texmflocal);
+ TeXLive::TLUtils::create_updmap($tlpdb,$texmfsysvar,$texmflocal);
+ TeXLive::TLUtils::create_language($tlpdb,$texmfsysvar,$texmflocal);
=head2 Miscellaneous
@@ -88,6 +91,9 @@ BEGIN {
&additional_architectures_available_from_net
&make_var_skeleton
&sub make_local_skeleton
+ &create_fmtutil
+ &create_updmap
+ &create_language
&sort_uniq
&push_uniq
&member
@@ -699,6 +705,94 @@ sub make_local_skeleton {
=pod
+=item C<create_fmtutil($tlpdb, $texmfsysvar, $texmflocal)>
+
+=item C<create_updmap($tlpdb, $texmfsysvar, $texmflocal)>
+
+=item C<create_language($tlpdb, $texmfsysvar, $texmflocal)>
+
+These three functions create fmtutil.cnf, updmap.cfg, and language.dat in
+below $texmfsysvar (which should be TEXMFSYSVAR). These functions merge
+the information present in the TLPDB $tlpdb (formats, maps, hyphenations)
+with local configuration additions: $texmflocal/web2c/fmtutil-local.cnf,
+$texmflocal/web2c/updmap-local.cfg, and
+$texmflocal/tex/generic/config/language-local.dat.
+
+Currently the "merging" is done trivially by appending the content of
+the local configuration files at the end of the file. This could be
+improved (checking for duplicates).
+
+=cut
+
+sub create_fmtutil {
+ my ($tlpdb,$texmfsysvar,$texmlocalpath) = @_;
+ my $root = $tlpdb->root;
+ my @lines = $tlpdb->fmtutil_cnf_lines;
+ if (-r "$texmflocalpath/web2c/fmtutil-local.cnf") {
+ #
+ # this should be done more intelligently, but for now only add those
+ # lines without any duplication check ...
+ open FOO, "<$texmflocalpath/web2c/fmtutil-local.cnf"
+ or die "strange -r but cannot open?\n";
+ my @tmp = <FOO>;
+ push @lines, @tmp;
+ }
+ if ($#lines >= 0) {
+ my $fmtutilpath = "$texmfsysvar/web2c/fmtutil.cnf";
+ open(OUTFILE,">$fmtutilpath")
+ or die("Cannot open $fmtutilpath for writing!\n");
+ foreach (@lines) { print OUTFILE; }
+ close(OUTFILE);
+ }
+}
+
+sub create_updmap {
+ my ($tlpdb,$texmfsysvar,$texmlocalpath) = @_;
+ my $root = $tlpdb->root;
+ my @lines = $tlpdb->updmap_cfg_lines;
+ if (-r "$texmflocalpath/web2c/updmap-local.cfg") {
+ #
+ # this should be done more intelligently, but for now only add those
+ # lines without any duplication check ...
+ open FOO, "<$texmflocalpath/web2c/updmap-local.cfg"
+ or die "strange -r but cannot open?\n";
+ my @tmp = <FOO>;
+ push @lines, @tmp;
+ }
+ if ($#lines >= 0) {
+ my $updmapcfgpath = "$texmfsysvar/web2c/updmap.cfg";
+ open(OUTFILE,">$updmapcfgpath")
+ or die("Cannot open $updmapcfgpath for writing!\n");
+ foreach (@lines) { print OUTFILE; }
+ close(OUTFILE);
+ }
+}
+
+sub create_language {
+ my ($tlpdb,$texmfsysvar,$texmlocalpath) = @_;
+ my $root = $tlpdb->root;
+ my @lines = $tlpdb->language_dat_lines;
+ if (-r "$texmflocalpath/tex/generic/config/language-local.dat") {
+ #
+ # this should be done more intelligently, but for now only add those
+ # lines without any duplication check ...
+ open FOO, "<$texmflocalpath/tex/generic/config/language-local.dat"
+ or die "strange -r but cannot open?\n";
+ my @tmp = <FOO>;
+ push @lines, @tmp;
+ }
+ if ($#lines >= 0) {
+ my $lanpath = "$texmfsysvar/tex/generic/config/language.dat";
+ open(OUTFILE,">$lanpath")
+ or die("Cannot open $lanpath for writing!\n");
+ foreach (@lines) { print OUTFILE; }
+ close(OUTFILE);
+ }
+}
+
+
+=pod
+
=back
=head2 Miscellaneous
@@ -780,6 +874,8 @@ sub debug {
print STDERR "tldbg: @_\n" if $::opt_debug;
}
+
+
#############################################
#
# Taken from Text::ParseWords