summaryrefslogtreecommitdiff
path: root/Master/tlpkg
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
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')
-rw-r--r--Master/tlpkg/TODO4
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm96
2 files changed, 96 insertions, 4 deletions
diff --git a/Master/tlpkg/TODO b/Master/tlpkg/TODO
index e609df6fdf4..fecc6c444ef 100644
--- a/Master/tlpkg/TODO
+++ b/Master/tlpkg/TODO
@@ -19,10 +19,6 @@ installer
stating that the file is generated and the user should add stuff
to the above config files ...
-- implement a managing program that does the same as the installer, i.e.
- updates the 3 config files from the installed stuff plus the -local
- files, and calls the respective programs
-
infra structure
---------------
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