summaryrefslogtreecommitdiff
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
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
-rwxr-xr-xMaster/install-tl.pl69
-rw-r--r--Master/tlpkg/TODO4
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm96
3 files changed, 101 insertions, 68 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index a6643eb7358..653affbb69a 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -24,7 +24,8 @@ BEGIN {
use TeXLive::TLUtils qw(initialize_installer media platform platform_desc
debug which getenv win32 unix program_exists architectures_available
additional_architectures_available_from_net get_system_tmpdir member
- mkdirhier make_var_skeleton make_local_skeleton install_package copy);
+ mkdirhier make_var_skeleton make_local_skeleton install_package copy
+ create_fmtutil create_updmap create_language);
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLConfig;
@@ -169,9 +170,9 @@ if ($opt_profile eq "") {
calc_depends();
prepare_installation();
do_install_packages();
-create_fmtutil();
-create_updmap();
-create_language();
+create_fmtutil($localtlpdb,$vars{'TEXMFSYSVAR'},$vars{'TEXMFLOCAL'});
+create_updmap($localtlpdb,$vars{'TEXMFSYSVAR'},$vars{'TEXMFLOCAL'});
+create_language($localtlpdb,$vars{'TEXMFSYSVAR'},$vars{'TEXMFLOCAL'});
do_postinst_stuff();
dump_vars('./vars');
# if we installed from a profile we don't need to write it out
@@ -534,66 +535,6 @@ sub do_install_packages {
$localtlpdb->save;
}
-sub create_fmtutil {
- my @lines = $localtlpdb->fmtutil_cnf_lines;
- if (-r "$vars{'TEXMFLOCAL'}/web2c/fmtutil-local.cnf") {
- #
- # this should be done more intelligently, but for now only add those
- # lines without any duplication check ...
- open FOO, "<$vars{'TEXMFLOCAL'}/web2c/fmtutil-local.cnf"
- or die "strange -r but cannot open?\n";
- my @tmp = <FOO>;
- push @lines, @tmp;
- }
- if ($#lines >= 0) {
- my $fmtutilpath = "$vars{'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 @lines = $localtlpdb->updmap_cfg_lines;
- if (-r "$vars{'TEXMFLOCAL'}/web2c/updmap-local.cfg") {
- #
- # this should be done more intelligently, but for now only add those
- # lines without any duplication check ...
- open FOO, "<$vars{'TEXMFLOCAL'}/web2c/updmap-local.cfg"
- or die "strange -r but cannot open?\n";
- my @tmp = <FOO>;
- push @lines, @tmp;
- }
- if ($#lines >= 0) {
- my $updmapcfgpath = "$vars{'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 @lines = $localtlpdb->language_dat_lines;
- if (-r "$vars{'TEXMFLOCAL'}/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, "<$vars{'TEXMFLOCAL'}/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 = "$vars{'TEXMFSYSVAR'}/tex/generic/config/language.dat";
- open(OUTFILE,">$lanpath")
- or die("Cannot open $lanpath for writing!\n");
- foreach (@lines) { print OUTFILE; }
- close(OUTFILE);
- }
-}
-
# do_postinst_stuff has to fix up the texmf tree and install some missing
# files. The things to do are taken from the install-live.sh installer
# of former times, and should be critically checked.
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