summaryrefslogtreecommitdiff
path: root/Master/install-tl.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/install-tl.pl')
-rwxr-xr-xMaster/install-tl.pl49
1 files changed, 33 insertions, 16 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index 56d0a27734d..e55a2f21932 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -18,7 +18,7 @@ BEGIN {
}
use TeXLive::TLUtils qw(initialize_installer media platform platform_desc
- which getenv win32 unix program_exists architectures_available
+ debug which getenv win32 unix program_exists architectures_available
additional_architectures_available_from_net get_system_tmpdir member);
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
@@ -143,8 +143,13 @@ sub set_texlive_default_dirs {
sub calc_depends {
my $size;
- # First look for packages in the selected scheme.
+ # we have to reset the install hash EVERY TIME otherwise everything will
+ # always be installed since the default is scheme-full which selects
+ # all packages and never deselects it
+ %install = ();
+
+ # First look for packages in the selected scheme.
my $scheme=$tlpdb->get_package($vars{'selected_scheme'});
for my $scheme_content ($scheme->depends) {
@@ -186,11 +191,14 @@ sub calc_depends {
my $collection=$tlpdb->get_package($selected_collection);
for my $package ($collection->depends) {
- my $tlpobj = $tlpdb->get_package{$package};
+ my $tlpobj = $tlpdb->get_package($package);
+ if (not(defined($tlpobj))) {
+ die "Cannot find $package in texlive.tlpdb, strange!\n";
+ }
if ($tlpobj->category eq "Collection") {
push @tmp, $package unless ((member($package, @allcollections)) ||
(member($package, @tmp)));
- } elseif (($tlpobj->category eq "Package") ||
+ } elsif (($tlpobj->category eq "Package") ||
($tlpobj->category eq "Documentation")) {
$install{"$package"}=1;
$size+=$tlpobj->docsize if $vars{'option_doc'};
@@ -207,10 +215,12 @@ sub calc_depends {
# an external package that ships all binaries in one
foreach my $a (@archs) {
# might be non existing ...
- $size += $tlpobj->binsize{$a};
+ if (defined($tlpobj->binsize->{$a})) {
+ $size += $tlpobj->binsize->{$a};
+ }
}
# take care for doc splitting
- if (grep(/^depend $package.ARCH/, $tlpobj->depends)) {
+ if (grep(/^$package.ARCH/, $tlpobj->depends)) {
foreach my $a (@archs) {
$install{"$package.$a"} = 1;
my $bintlp = $tlpdb->get_package("$package.$a");
@@ -218,10 +228,13 @@ sub calc_depends {
die "Cannot find $package.$a in texlive.tlpdb, exit!\n";
}
# $package.$arch package are supposed to contain ONLY binfiles
- $size += $bintlp->binsize{$a};
+ $::opt_debug = 1;
+ debug("$package.$a: binsize=",$bintlp->binsize->{$a},"\n");
+ $::opt_debug = 0;
+ $size += $bintlp->binsize->{$a} if defined($bintlp->binsize->{$a});
}
}
- } elseif ($tlpobj->category eq "Scheme") {
+ } elsif ($tlpobj->category eq "Scheme") {
warn "We shouldn't work on Schemes here?!? package = $package\n";
} else {
die "Unknown category ", $tlpobj->category, " of package $package -- ex!";
@@ -984,10 +997,9 @@ sub create_profile {
sub prepare_installation {
my $destdir = $vars{"TEXDIR"};
my $texmfvar = $vars{"TEXMFSYSVAR"};
- `echo mkdir -p "$destdir"`;
- `echo mkdir -p "$destdir/$texlive_release"`;
- `echo mkdir -p "$destdir/$texlive_release/$TeXLive::TLConfig::InfraLocation"`;
- `echo mkdir -p "$texmfvar"`;
+ `mkdir -p "$destdir"`;
+ `mkdir -p "$destdir/$TeXLive::TLConfig::InfraLocation"`;
+ `mkdir -p "$texmfvar"`;
my $localtlpdbpath = "$destdir/$TeXLive::TLConfig::InfraLocation/texlive.tlpdb";
$::localtlpdb = new TeXLive::TLPDB;
$::localtlpdb->location("$localtlpdbpath");
@@ -1009,7 +1021,7 @@ sub add_tlpcontainer {
$unpackprog="unzip -o -qq $container -d $dest";
} elsif (-r "$container.tar.lzma") {
$container.=".tar.lzma";
- $unpackprog="lzcat $conainer | tar -xf - -C $dest";
+ $unpackprog="lzcat $container | tar -xf - -C $dest";
die("lzma is checked for but not implemented, please edit TLPDB.pm\n");
} else {
warn "Cannot find a package $package (.zip or .lzma) in $ziplocation\n";
@@ -1039,17 +1051,22 @@ sub install_files {
# for each package listed as a key of %install all the files contained
# in it
# we have to get the arch first:
- my @archs = ();
+ my @archs;
foreach (keys %vars) {
if (m/^diskbin_(.*)$/ ) {
- if ($vars{$_}) {push @archs, $1;}
+ if ($vars{$_}) { push @archs, $1; }
+ }
+ if (m/^netbin_(.*)$/ ) {
+ if ($vars{$_}) { push @archs, $1; }
}
}
- my $destination="$vars{TEXDIR}/$texlive_release";
+ my $destination="$vars{TEXDIR}";
foreach my $p (keys %install) {
+ print "INSTALL $p\n" if ($install{$p} == 1);
my $containerdir=container_location($p);
add_tlpcontainer($p, $containerdir, $destination);
}
+ $::localtlpdb->save;
}
load_tlpdb;