summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/install-tl.pl120
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm25
-rw-r--r--Master/tlpkg/texlive.tlpdb2
3 files changed, 73 insertions, 74 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'}");
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 3aaaff8aded..0fb2400518b 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -34,6 +34,7 @@ C<TeXLive::TLPDB> -- A database of TeX Live Packages
$tlpdb->fmtutil_cnf_lines;
$tlpdb->language_dat_lines;
$tlpdb->package_revision("packagename");
+ $tlpdb->location;
TeXLive::TLPDB->listdir([$dir]);
$tlpdb->generate_listfiles([$destdir]);
@@ -98,7 +99,7 @@ sub add_tlpobj {
=item C<< $tlpdb->from_file($filename) >>
The C<from_file> function initializes the C<TLPDB> in case the
-location was not given at generation time. If C<$filename> begins
+root was not given at generation time. If C<$filename> begins
with C<http://> or C<ftp://>, the program C<wget> is used to download
the file.
@@ -168,8 +169,8 @@ as location. If the location is undefined, die.
sub save {
my $self = shift;
- my $path = "$self->{'root'}/$InfraLocation/$DatabaseName";
- mkdirhier("$self->{'root'}/$InfraLocation");
+ my $path = $self->location;
+ mkdirhier(dirname($path));
open(FOO,">$path") || die("Cannot open $path for writing: $!");
$self->writeout(\*FOO);
close(FOO);
@@ -481,6 +482,24 @@ sub root {
=pod
+=item C<< $tlpdb->location >>
+
+The function C<location> returns the location of the actual C<texlive.tlpdb>
+file used. Note that this is a read-only function, you cannot change
+the root of the TLPDB using this function.
+
+=cut
+
+sub location {
+ my $self = shift;
+ return "$self->{'root'}/$InfraLocation/$DatabaseName";
+}
+
+=pod
+
+
+=pod
+
=item C<< $tlpdb->listdir >>
The function C<listdir> allows to read and set the packages variable
diff --git a/Master/tlpkg/texlive.tlpdb b/Master/tlpkg/texlive.tlpdb
index 4bca6ff19a3..5f3c44be3a6 100644
--- a/Master/tlpkg/texlive.tlpdb
+++ b/Master/tlpkg/texlive.tlpdb
@@ -28757,7 +28757,7 @@ category Collection
revision 5725
shortdesc Essential binaries
longdesc These programs are regarded as basic for any TeX system.
-depend lib-regexp
+depend lib-regex
depend lib-zlib
depend bin-bibtex
depend bin-dialog