summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-30 11:53:14 +0000
committerNorbert Preining <preining@logic.at>2007-11-30 11:53:14 +0000
commitc710b203fa04e47c1dfebca72868d0ecea4cbb91 (patch)
tree5b22c3d1a1846d11ccc3e53c7acb1a009923a60a /Master
parent0a3a6c3abaafb43615003d9269707335021f3967 (diff)
work on installer, we are close (at least on unixes)
git-svn-id: svn://tug.org/texlive/trunk@5656 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/install-tl.pl210
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm28
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm2
3 files changed, 149 insertions, 91 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index ac63db0d599..0627fb43010 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -7,7 +7,11 @@
# This file is licensed under the GNU General Public License version 2
# or any later version.
-$texlive_release="2008";
+my $texlive_release="2008";
+
+# the location where this script resides, needs to be our
+# because it is used in TeXLive::TLUtils
+our $installerdir;
BEGIN {
$^W = 1;
@@ -24,14 +28,54 @@ 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);
+ mkdirhier make_var_skeleton make_local_skeleton install_package copy);
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
use TeXLive::TLConfig;
use Getopt::Long;
use Cwd;
-$default_scheme='scheme-full';
+use strict;
+
+# used variables
+#
+# $install{$packagename} == 1 if it should be installed
+my %install;
+# place where the profile should be saved
+my $profilepath = '.';
+# if we should try to get additional binaries from the net
+my $trynet=0;
+# the url of net location, can be changed with -url ....
+my $texlive_url = 'http://tug.org/svn/texlive/trunk/Master';
+# the default scheme to be installed
+my $default_scheme='scheme-full';
+# some arrays where the lists of collections to be installed are saved
+my @collections_std;
+my @collections_lang;
+my @collections_lang_doc;
+# The maximum number of binary systems on the CD. This number must be
+# smaller than the number of binaries available from the network.
+my $max_bins_on_CD=7;
+# The global variable %vars is an associative list which contains all
+# variables and their values which can be changed by the user.
+# needs to be our since TeXLive::TLUtils uses it
+our %vars=( # 'n_' means 'number of'.
+ 'this_platform' => platform(),
+ 'n_systems_available' => 0,
+ 'n_systems_selected' => 0,
+ 'n_collections_selected' => 0,
+ 'n_collections_available' => 0,
+ 'total_size' => 0,
+ 'option_symlinks' => 0,
+ 'sys_bin' => '/usr/local/bin',
+ 'sys_man' => '/usr/local/man',
+ 'sys_info' => '/usr/local/info',
+ 'option_doc' => 1,
+ 'option_src' => 1,
+ 'option_fmt' => 0,
+ 'option_letter' => 0,
+ 'selected_scheme' => $default_scheme,
+ );
# option handling
my $opt_media = "";
@@ -48,36 +92,54 @@ if ("$opt_media" eq "CD") {
$::_media_ = "DVD";
}
+
if ("$opt_url" ne "") {
$texlive_url = "$opt_url";
-} else {
- $texlive_url='http://tug.org/svn/texlive/trunk/Master';
}
-$texlive_db_url="$texlive_url/$TeXLive::TLConfig::InfraLocation";
-
-# The maximum number of binary systems on the CD. This number must be
-# smaller than the number of binaries available from the network.
-$max_bins_on_CD=7;
+my $texlive_db_url="$texlive_url/$TeXLive::TLConfig::InfraLocation";
+# the TLPDB instances we will use. $tlpdb is for the one from the installation
+# media, while $localtlpdb is for the new installation
+my $tlpdb;
+my $localtlpdb;
-my $system_tmpdir=get_system_tmpdir;
+my $system_tmpdir=get_system_tmpdir();
print "Platform: ", platform, " => \'", platform_desc(platform), "\'\n";
print "Media: ", media, "\n";
-print "Directory for Temporary Files: '", get_system_tmpdir, "\'\n";
-print "Installer Directory: '$::installerdir'\n";
+print "Directory for Temporary Files: '", $system_tmpdir, "\'\n";
+print "Installer Directory: '$installerdir'\n";
+
+initialize_installer();
+load_tlpdb();
+set_platforms_supported();
+set_texlive_default_dirs();
+initialize_collections();
+set_install_platform();
+run_menu();
+calc_depends();
+prepare_installation();
+do_install_packages();
+parse_executes_and_create_files();
+do_postinst_stuff();
+dump_vars('./vars');
+create_profile();
+print "Profile written to $profilepath/texlive.profile\n";
-initialize_installer;
+exit(0);
-# The global variable %vars is an associative list which contains all
-# variables and their values which can be changed by the user.
-our %vars;
+###################################################################
+#
+# FROM HERE ON ONLY SUBROUTINES
+# NO VARIABLE DECLARATIONS
+#
+###################################################################
sub dump_vars {
my $filename=shift;
open VARS, ">$filename";
- foreach $key (keys %vars) {
+ foreach my $key (keys %vars) {
print VARS "$key $vars{$key}\n";
}
close VARS;
@@ -86,7 +148,6 @@ sub dump_vars {
# Determine which platforms are supported.
-$trynet=0;
sub set_platforms_supported {
my @binaries=architectures_available;
for my $binary (@binaries) {
@@ -145,24 +206,6 @@ sub set_texlive_default_dirs {
}
-%vars=( # 'n_' means 'number of'.
- 'this_platform' => platform,
- 'n_systems_available' => 0,
- 'n_systems_selected' => 0,
- 'n_collections_selected' => 0,
- 'n_collections_available' => 0,
- 'total_size' => 0,
- 'option_symlinks' => 0,
- 'sys_bin' => '/usr/local/bin',
- 'sys_man' => '/usr/local/man',
- 'sys_info' => '/usr/local/info',
- 'option_doc' => 1,
- 'option_src' => 1,
- 'option_fmt' => 0,
- 'option_letter' => 0,
- 'selected_scheme' => $default_scheme,
- );
-
sub calc_depends {
my $size;
@@ -343,10 +386,9 @@ sub load_tlpdb {
$database="$installerdir/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb";
}
print "Loading $database ...\n";
- $::tlpdb=TeXLive::TLPDB->new(location => "$database");
+ $tlpdb=TeXLive::TLPDB->new(location => "$database");
}
-
sub initialize_collections {
foreach my $pkg ($tlpdb->list_packages) {
my $tlpobj = $tlpdb->{'tlps'}{$pkg};
@@ -552,7 +594,7 @@ sub scheme_menu {
++$index;
}
- foreach $entry (keys %vars) {
+ foreach my $entry (keys %vars) {
if ($entry=~/^(collection-.*)/) {
$vars{"$1"}=0;
}
@@ -1023,7 +1065,6 @@ EOF
}
-
sub create_profile {
# The file "TLprofile" is created at the beginning of the
# installation process and contains information about the current
@@ -1052,44 +1093,44 @@ sub prepare_installation {
make_var_skeleton "$vars{'TEXMFSYSVAR'}";
make_local_skeleton "$vars{'TEXMFLOCAL'}";
- $::localtlpdb=new TeXLive::TLPDB;
- $::localtlpdb->location("$localtlpdbfile");
+ $localtlpdb=new TeXLive::TLPDB;
+ $localtlpdb->location("$localtlpdbfile");
}
sub do_install_packages {
foreach my $package (sort keys %install) {
print "INSTALL $package\n" if ($install{$package} == 1);
- my $tlpobj=$::tlpdb->get_package($package);
+ my $tlpobj=$tlpdb->get_package($package);
if (&media eq 'DVD') {
my @allfiles = $tlpobj->all_files;
install_package(@allfiles);
} elsif (&media eq 'CD') {
my $cwd = getcwd;
my $container = "$package";
- if (-r "$::installerdir/archive/$package.zip") {
+ if (-r "$installerdir/archive/$package.zip") {
$container = "$package.zip";
- } elsif (-r "$::installerdir/archive/$package.tar.lzma") {
+ } elsif (-r "$installerdir/archive/$package.tar.lzma") {
$container = "$package.tar.lzma";
} else {
# for now only warn and return, should (?) be die!?
- warn "Cannot find a package $package (.zip or .lzma) in $::installerdir/archive\n";
+ warn "Cannot find a package $package (.zip or .lzma) in $installerdir/archive\n";
next;
}
install_package($container);
} elsif (&media eq 'NET') {
install_package("$package.$TeXLive::TLConfig::DefaultContainerExtension");
}
- $::localtlpdb->add_tlpobj($tlpobj);
+ $localtlpdb->add_tlpobj($tlpobj);
}
- $::localtlpdb->save;
+ $localtlpdb->save;
}
sub parse_executes_and_create_files {
my %maps;
my %fmtcnffiles;
my %hypcnffiles;
- foreach my $p ($::localtlpdb->list_packages) {
+ 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) {
@@ -1158,28 +1199,55 @@ sub parse_executes_and_create_files {
}
}
+#
+# 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.
+sub do_postinst_stuff {
+ # create useful skeletions
+ make_var_skeleton("$vars{'TEXMFSYSVAR'}");
+ make_local_skeleton("$vars{'TEXDIR'}/texmf-local");
+ # install some copies from texmf(-dist) into texmf-var
+ copy ("$vars{'TEXDIR'}/texmf-dist/tex/plain/config/language.def",
+ "$vars{'TEXMFSYSVAR'}/tex/plain/config")
+ if (-f "$vars{'TEXDIR'}/texmf-dist/tex/plain/config/language.def");
+ copy ("$vars{'TEXDIR'}/texmf/xdvi/XDvi",
+ "$vars{'TEXMFSYSVAR'}/xdvi")
+ if (-f "$vars{'TEXDIR'}/texmf/xdvi/XDvi");
+
+ # those files must exist
+ copy ("$vars{'TEXDIR'}/texmf/dvips/config/config.ps",
+ "$vars{'TEXMFSYSVAR'}/dvips/config");
+ copy ("$vars{'TEXDIR'}/texmf/dvipdfm/config/config",
+ "$vars{'TEXMFSYSVAR'}/dvipdfm/config");
+ copy ("$vars{'TEXDIR'}/texmf/web2c/mktex.cnf",
+ "$vars{'TEXMFSYSVAR'}/web2c");
+
+ # the old installer copied from CDDIR, but shouldn't this be installed
+ # in ANY case since it is in bin-pdftex???
+ copy ("$vars{'TEXDIR'}/texmf/tex/generic/config/pdftexconfig.tex",
+ "$vars{'TEXMFSYSVAR'}/tex/generic/config");
+
+ # old installer did this, should we do this, TOO????
+ #cp $CDDIR/texmf-dist/tex/context/config/cont-usr.tex $TEXMFSYSVAR/tex/context/config/cont-usr.tex
+
+
+
+ # MISSING
+ # we need to run mktexlsr and updmap-sys ....
+
+ # quick and dirty for now
+ # we need to set the path correct!!!!
+ `$vars{'TEXDIR'}/bin/$vars{'this_platform'}/mktexlsr $vars{'TEXDIR'}/texmf-dist $vars{'TEXDIR'}/texmf $vars{'TEXDIR'}/texmf-local`;
+ `$vars{'TEXDIR'}/bin/$vars{'this_platform'}/updmap-sys --nohash --cnffile=$vars{'TEXMFSYSVAR'}/web2c/updmap.cfg --dvipsoutputdir=$vars{'TEXMFSYSVAR'}/fonts/map/dvips/updmap \ --dvipdfmoutputdir=$vars{'TEXMFSYSVAR'}/fonts/map/dvipdfm/updmap --pdftexoutputdir=$vars{'TEXMFSYSVAR'}/fonts/map/pdftex/updmap `;
+ `$vars{'TEXDIR'}/bin/$vars{'this_platform'}/mktexlsr $vars{'TEXMFSYSVAR'}`;
+
+ # old installer:
+ #$config && texconfig-sys init
+ #$config || echo "PLEASE RUN texconfig or texconfig-sys to make new formats."
+
+}
-load_tlpdb;
-set_platforms_supported;
-set_texlive_default_dirs;
-initialize_collections;
-set_install_platform;
-run_menu;
-calc_depends;
-prepare_installation;
-do_install_packages;
-
-parse_executes_and_create_files;
-#
-# what more has to be done:
-# - create texmf.cnf with right settings
-# - create mktex.cnf ???
-# - ???
-
-dump_vars './vars';
-$profilepath='.';
-create_profile;
-print "Profile written to $profilepath/texlive.profile\n";
__END__
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 5303e7d605c..752746f3834 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -349,29 +349,14 @@ sub generate_listfiles {
}
foreach (sort keys %{$self->{'tlps'}}) {
$tlp = $self->{'tlps'}{$_};
- $self->_generate_listfile($tlp, $destdir, "all");
- if ($tlp->is_arch_dependent) {
- foreach my $a (keys %{$tlp->binfiles}) {
- $self->_generate_listfile($tlp, $destdir, $a);
- }
- }
+ $self->_generate_listfile($tlp, $destdir);
}
}
sub _generate_listfile {
- my ($self,$tlp,$destdir,$arch) = @_;
- my @files = ();
- my $listname;
- if ($arch ne "all") {
- my %foo = %{$tlp->binfiles};
- push @files, @{$foo{$arch}};
- $listname = $tlp->name . ".$arch";
- } else {
- $listname = $tlp->name;
- push @files, $tlp->runfiles;
- push @files, $tlp->docfiles;
- push @files, $tlp->srcfiles;
- }
+ my ($self,$tlp,$destdir) = @_;
+ my $listname = $tlp->name;
+ my @files = $tlp->all_files;
@files = TeXLive::TLUtils::sort_uniq(@files);
&mkpath("$destdir") if (! -d "$destdir");
my (@lop, @lot);
@@ -384,7 +369,10 @@ sub _generate_listfile {
push @lop, $d;
}
} else {
- warn "Strange: $tlp->name depends on $d, but this package does not exists!\n";
+ # speudo dependencies on $Package.ARCH can be ignored
+ if ($d !~ m/\.ARCH$/) {
+ warn "Strange: $tlp->name depends on $d, but this package does not exists!\n";
+ }
}
}
open(TMP, ">$destdir/$listname") or die "Cannot open $destdir/$listname!";
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index fd6e53eb35f..968a5219f7d 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -671,6 +671,8 @@ sub make_var_skeleton {
mkdirhier "$prefix/fonts/map/dvipdfm/updmap";
mkdirhier "$prefix/fonts/map/dvips/updmap";
mkdirhier "$prefix/fonts/map/pdftex/updmap";
+ mkdirhier "$prefix/fonts/pk";
+ mkdirhier "$prefix/fonts/tfm";
mkdirhier "$prefix/web2c";
mkdirhier "$prefix/xdvi";
mkdirhier "$prefix/tex/context/config";