diff options
author | Norbert Preining <preining@logic.at> | 2007-12-10 00:06:36 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-12-10 00:06:36 +0000 |
commit | 19bdda3e5896455a8506703c4ed5ab6170dbdde5 (patch) | |
tree | d497c22472448f909045a18745d2988293b69a95 /Master/install-tl.pl | |
parent | d135d43d99dbe0717ddc74114c2f93007887a9f7 (diff) |
- add TLPDB->location
- fix texlive.tlpdb
- rework the dependency resolver in install-tl.pl
git-svn-id: svn://tug.org/texlive/trunk@5738 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl.pl')
-rwxr-xr-x | Master/install-tl.pl | 120 |
1 files changed, 50 insertions, 70 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 3dca5d87116..fdd34b787da 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -270,38 +270,30 @@ sub set_texlive_default_dirs { $vars{'TEXMFHOME'}="$texmfhome/texmf"; } - sub calc_depends { - my $size; - # 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=(); + # initialize the %install hash with what should be installed + # First look for packages in the selected scheme. my $scheme=$tlpdb->get_package($vars{'selected_scheme'}); for my $scheme_content ($scheme->depends) { $install{"$scheme_content"}=1 unless ($scheme_content=~/^collection-/); } - + # Now look for collections in the %vars hash. These are not # necessarily the collections required by a scheme. The final # decision is made in the collections/languages menu. - - my @collections; - foreach my $key (keys %vars) { if ($key=~/^collection-/) { - push @collections, $key if $vars{$key}; + $install{$key} = 1 if $vars{$key}; } } - # 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) { @@ -313,70 +305,57 @@ sub calc_depends { } } - 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) { - 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))); - } elsif (($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") { - $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 + # loop over all the packages until it is getting stable + my $changed = 1; + while ($changed) { + # set $changed to 0 + $changed = 0; + + # collect the already selected packages + my @pre_selected = keys %install; + debug "initial number of installations: $#pre_selected\n"; + + # loop over all the pre_selected and add them + foreach my $p (@pre_selected) { + debug "pre_selected $p\n"; + foreach my $p_dep ($tlpdb->get_package($p)->depends) { + if ($p_dep =~ m/^(.*)\.ARCH$/) { + my $foo = "$1"; foreach my $a (@archs) { - # might be non existing ... - if (defined($tlpobj->binsize->{$a})) { - $size += $tlpobj->binsize->{$a}; - } + $install{"$foo.$a"} = 1; } - # take care for doc splitting - if (grep(/^$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 - $::opt_debug = 1; -# debug("$package.$a: binsize=",$bintlp->binsize->{$a},"\n"); - $::opt_debug = 0; - $size+=$bintlp->binsize->{$a} if defined($bintlp->binsize->{$a}); - } - } - } 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!"; + $install{$p_dep} = 1; } } } - push @allcollections, @tmp; - @workcoll = @tmp; + + # check for newly selected packages + my @post_selected = keys %install; + debug "number of post installations: $#post_selected\n"; + + # set repeat condition + if ($#pre_selected != $#post_selected) { + $changed = 1; + } + } + + # now do the size computation + my $size = 0; + foreach my $p (keys %install) { + my $tlpobj = $tlpdb->get_package($p); + if (not(defined($tlpobj))) { + die "Cannot find $p in texlive.tlpdb, strange!\n"; + } + $size+=$tlpobj->docsize if $vars{'option_doc'}; + $size+=$tlpobj->srcsize if $vars{'option_src'}; + $size+=$tlpobj->runsize; + foreach my $a (@archs) { + $size += $tlpobj->binsize->{$a} if defined($tlpobj->binsize->{$a}); + } } - $vars{'total_size'}= - sprintf "%d", ($size * $TeXLive::TLConfig::BlockSize)/1024**2; + $vars{'total_size'} = + sprintf "%d", ($size * $TeXLive::TLConfig::BlockSize)/1024**2; } sub load_tlpdb { @@ -386,7 +365,7 @@ sub load_tlpdb { } else { $master="$::installerdir"; } - print "Loading $master ...\n"; + print "Loading $master/$TeXLive::TLConfig::InfraLocation/$TeXLive::TLConfig::DatabaseName ...\n"; $tlpdb=TeXLive::TLPDB->new(root => "$master"); } @@ -501,6 +480,7 @@ sub read_profile { sub prepare_installation { make_var_skeleton "$vars{'TEXMFSYSVAR'}"; make_local_skeleton "$vars{'TEXMFLOCAL'}"; + mkdirhier "$vars{'TEXDIR'}/texmf-config"; $localtlpdb=new TeXLive::TLPDB; $localtlpdb->root("$vars{'TEXDIR'}"); |