summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinhard Kotucha <reinhard.kotucha@web.de>2007-11-17 23:57:54 +0000
committerReinhard Kotucha <reinhard.kotucha@web.de>2007-11-17 23:57:54 +0000
commite1cf7f66cc15bd5bab4289305668b4655b5346ed (patch)
tree021c2fe04831eb9e7519273f5c68ca86cb760fc2
parent283a33b15991ed662e16f59bf01f677274178af1 (diff)
binsize supported.
git-svn-id: svn://tug.org/texlive/trunk@5498 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/install-tl.pl130
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm22
2 files changed, 89 insertions, 63 deletions
diff --git a/Master/install-tl.pl b/Master/install-tl.pl
index 9d5e92bbdcf..932558e2da2 100755
--- a/Master/install-tl.pl
+++ b/Master/install-tl.pl
@@ -7,7 +7,7 @@
# This file is licensed under the GNU General Public License version 2
# or any later version.
-$texlive_release="2007";
+$texlive_release="2008";
BEGIN {
$^W = 1;
@@ -23,6 +23,7 @@ use TeXLive::TLUtils qw(initialize_installer media platform platform_desc
use TeXLive::TLPOBJ;
use TeXLive::TLPDB;
+
$default_scheme='scheme-full';
###$texlive_url='http://localhost/texlive/Contents/inst';
@@ -48,12 +49,13 @@ print "Directory for Temporary Files: '", get_system_tmpdir, "\'\n";
my %vars;
sub dump_vars {
- open VARS, ">./vars";
+ my $filename=shift;
+ open VARS, ">$filename";
foreach $key (keys %vars) {
print VARS "$key $vars{$key}\n";
}
close VARS;
- print "\n%vars dumped to ./vars.\n";
+ print "\n%vars dumped to '$filename'.\n";
}
@@ -135,6 +137,71 @@ sub set_texlive_default_dirs {
);
+sub calc_depends {
+ my $size;
+ # 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};
+ }
+ }
+
+ # 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.
+
+ foreach my $selected_collection (@collections) {
+ my $collection=$tlpdb->get_package($selected_collection);
+
+ for my $package ($collection->depends) {
+ if ($package=~/^collection-/) {
+ push @collections, $package
+ unless member $package, @collections;
+ } else {
+ my $tlpobj = $tlpdb->{'tlps'}{$package};
+ if ($tlpobj->category eq "Package") {
+ $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") {
+ 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};
+ }
+ }
+ } else {
+ $install{"$package"}=1;
+ }
+ }
+ }
+ }
+ }
+ $vars{'total_size'}=sprintf "%d", $size/1024**2;
+# printf "Total: %d MB\n", $size/1024**2;
+}
+
+
+
sub clear_screen {
# return 0;
(unix)? system 'clear':system 'cls';
@@ -767,7 +834,7 @@ EOF
sub quit {
- dump_vars;
+ dump_vars './vars';
exit 0;
}
@@ -797,6 +864,7 @@ sub main_menu {
++$vars{'n_collections_selected'} if $vars{$key}==1;
}
}
+ calc_depends;
my %command=(
'self' => \&main_menu,
@@ -860,60 +928,12 @@ EOF
}
-sub calc_depends {
- # 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};
- }
- }
-# printf "%d collections\n", @collections+0;
-
- # 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.
-
- foreach my $selected_collection (@collections) {
- my $collection=$tlpdb->get_package($selected_collection);
-
- for my $collection_content ($collection->depends) {
- if ($collection_content=~/^collection-/) {
- push @collections, $collection_content
- unless member $collection_content, @collections;
- } else {
- $install{"$collection_content"}=1;
- }
- }
- }
-# printf "%d\n", @collections+0;
-# print "---------------\n";
-# foreach my $pkg (keys %install) {
-# print "Package $pkg\n";
-# }
-# print "---------------\n";
-# foreach my $col (@collections) {
-# print "$col\n";
-# }
-}
sub create_profile {
# The file "TLprofile" is created at the beginning of the
# installation process and contains information about the current
# setup. The purpose is to allow non-interactive installations.
- open PROFILE, ">$profilepath/TLprofile";
+ open PROFILE, ">$profilepath/texlive.profile";
print PROFILE "selected_scheme $vars{selected_scheme}\n";
foreach my $key (keys %vars) {
print PROFILE "$key $vars{$key}\n"
@@ -935,10 +955,10 @@ run_menu;
calc_depends;
-dump_vars;
+dump_vars './vars';
$profilepath='.';
create_profile;
-print "Profile written to $profilepath/TLprofile\n";
+print "Profile written to $profilepath/texlive.profile\n";
__END__
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 4f8e467ee37..3f243f08ac3 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -413,7 +413,7 @@ on UNIX systems. On Windows, C<(-l $file)> will certainly never
return 'C<true>' and symlinks will be copied as regular files.
C<copy> invokes C<mkdirhier> if target directories do not exist.
-Files have mode C<0777>-I<umask> if they are execuatble and
+Files have mode C<0777>-I<umask> if they are executable and
C<0666>-I<umask> otherwise.
=cut
@@ -573,15 +573,21 @@ C<%vars> hash.
sub additional_architectures_available_from_net {
my $vars=shift;
my @platforms;
- my $database="$::texlive_url/texlive.tlpdb";
+ my $database="$::texlive_url/texlive.pkgver";
+
print "\nLoading '$database' ...\n";
- $::tlpdb_netbin=TeXLive::TLPDB->new(location => "$database");
- foreach my $arch ($::tlpdb_netbin->available_architectures) {
- unless (defined $vars->{"diskbin_$arch"}) {
- push @platforms, $arch;
- }
- }
+ open WGET, "wget -nv --output-document=- $database|";
+ while (<WGET>) {
+ chop;
+ my $line=$_;
+ next unless /-1$/;
+ ($platform, undef)=split " ", $line;
+ unless (defined $vars->{"diskbin_$platform"}) {
+ push @platforms, $platform;
+ }
+ }
return @platforms;
+ close WGET;
}
=pod