diff options
author | Norbert Preining <preining@logic.at> | 2007-11-22 10:14:01 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-11-22 10:14:01 +0000 |
commit | 7d52fb22c1080250b0d0c0aa1d2064b565ca2c8d (patch) | |
tree | e627e877f184334daae379d15e6f242c41fb2c65 /Master | |
parent | bc464312f8f3e766f631e37b9f3cc83d256311f7 (diff) |
fix install-tl.pl's handling of binfiles splitting, and rework the
calc_depends function
git-svn-id: svn://tug.org/texlive/trunk@5547 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl.pl | 75 |
1 files changed, 51 insertions, 24 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 4572aafe76e..56d0a27734d 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -166,49 +166,76 @@ sub calc_depends { # Now we look for packages in collections. A collection can contain # other collections. In this case we push it to the @collections # list if it doesn't exist already. + + # compute the list of archs to be installed + my @archs; + foreach (keys %vars) { + if (m/^diskbin_(.*)$/ ) { + if ($vars{$_}) { push @archs, $1; } + } + if (m/^netbin_(.*)$/ ) { + if ($vars{$_}) { push @archs, $1; } + } + } - foreach my $selected_collection (@collections) { - my $collection=$tlpdb->get_package($selected_collection); + my @workcoll = @collections; + my @allcollections = @collections; + while (@workcoll) { + my @tmp; + foreach my $selected_collection (@workcoll) { + my $collection=$tlpdb->get_package($selected_collection); - for my $package ($collection->depends) { - if ($package=~/^collection-/) { - push @collections, $package - unless member $package, @collections; - } else { + for my $package ($collection->depends) { my $tlpobj = $tlpdb->get_package{$package}; - if ($tlpobj->category eq "Package") { + if ($tlpobj->category eq "Collection") { + push @tmp, $package unless ((member($package, @allcollections)) || + (member($package, @tmp))); + } elseif (($tlpobj->category eq "Package") || + ($tlpobj->category eq "Documentation")) { $install{"$package"}=1; $size+=$tlpobj->docsize if $vars{'option_doc'}; $size+=$tlpobj->srcsize if $vars{'option_src'}; $size+=$tlpobj->runsize; } elsif ($tlpobj->category eq "TLCore") { - # - # NORBERT: NEEDS TO BE REWORKED FOR binfiles SPLITTING!!!!! - # - if ($package=~/^bin-/) { - my %binsizes = $tlpobj->binsize; - foreach my $arch (keys %binsizes) { - if ((defined $vars{"diskbin_$arch"} and - $vars{"diskbin_$arch"}==1) || - (defined $vars{"netbin_$arch"} and - $vars{"netbin_$arch"}==1)) { - $install{"$package"}=1; - $size+=$binsizes{$arch}; + $install{"$package"} = 1; + $size+=$tlpobj->docsize if $vars{'option_doc'}; + $size+=$tlpobj->srcsize if $vars{'option_src'}; + $size+=$tlpobj->runsize; + # add the sizes of the binfiles of the package itself + # this should not be necessary for texlive internal packages + # because all of them are split, but someone might install + # an external package that ships all binaries in one + foreach my $a (@archs) { + # might be non existing ... + $size += $tlpobj->binsize{$a}; + } + # take care for doc splitting + if (grep(/^depend $package.ARCH/, $tlpobj->depends)) { + foreach my $a (@archs) { + $install{"$package.$a"} = 1; + my $bintlp = $tlpdb->get_package("$package.$a"); + if (not($bintlp)) { + die "Cannot find $package.$a in texlive.tlpdb, exit!\n"; } + # $package.$arch package are supposed to contain ONLY binfiles + $size += $bintlp->binsize{$a}; } - } else { - $install{"$package"}=1; } + } elseif ($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!"; } } } + push @allcollections, @tmp; + @workcoll = @tmp; } - $vars{'total_size'}=sprintf "%d", $size/1024**2; + $vars{'total_size'}=sprintf "%d", ($size * $TeXLive::TLConfig::BlockSize)/1024**2; # printf "Total: %d MB\n", $size/1024**2; } - sub clear_screen { # return 0; (unix)? system 'clear':system 'cls'; |