diff options
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r-- | Master/tlpkg/TeXLive/TLMedia.pm | 51 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 24 |
2 files changed, 5 insertions, 70 deletions
diff --git a/Master/tlpkg/TeXLive/TLMedia.pm b/Master/tlpkg/TeXLive/TLMedia.pm index 158fe862ed5..682c05e763b 100644 --- a/Master/tlpkg/TeXLive/TLMedia.pm +++ b/Master/tlpkg/TeXLive/TLMedia.pm @@ -13,57 +13,6 @@ use TeXLive::TLUtils qw(tllog copy win32 dirname mkdirhier conv_to_win_path base use TeXLive::TLPDB; use Cwd qw/abs_path/; -sub shortnew -{ - my ($class, $location) = @_; - my $media; - # of no argument is given we assume NET and default URL - $location = "$TeXLiveURL" unless (defined($location)); - # do media autodetection - if ($location =~ m,http://|ftp://,) { - $media = 'NET'; - } else { - if (-d "$location/texmf/web2c") { - $media = 'DVD'; - } elsif (-d "$location/$DiskArchive") { - $media = 'CD'; - } else { - die ("Cannot find the correct media for $location, please specify!"); - } - } - my $database; - if ($media eq 'NET') { - $database = "$location/$NetArchive/texlive.pkgver"; - open(WGET, "wget -q --output-document=- $database|") or - tllog($::LOG_NORMAL, "Cannot get texlive.pkgver the net!\n"); - } elsif ($media eq 'CD') { - $database = "$location/$DiskArchive/texlive.pkgver"; - open(WGET, "<$database") or - tllog($::LOG_NORMAL, "Cannot get texlive.pkgver from CD!\n"); - } else { - $database = "$location/$InfraLocation/texlive.pkgver"; - open(WGET, "<$database") or - tllog($::LOG_NORMAL, "Cannot get texlive.pkgver from DVD!\n"); - } - my %revs; - my @platforms; - while (<WGET>) { - chop; - my $line=$_; - my ($pkg, $rev) = split " ", $line; - $revs{$pkg} = $rev; - if ($rev == -1) { - push @platforms, $pkg; - } - } - $self->{'media'} = $media; - $self->{'location'} = $location; - %{ $self->{'pkgrevs'} } = %revs; - @{ $self->{'systems'} } = @platforms; - bless $self, $class; - return $self; -} - sub new { my ($class, $location) = @_; diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 429ad8741b3..e0fa075e473 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -968,37 +968,23 @@ sub architectures_available { =item C<additional_architectures_available_from_net (\%vars)> The function C<additional_architectures_available_from_net> returns a -list of additional platforms supported by the TeX Live server. It -downloads the file C<$TeXLiveURL/$NetArchive/texlive.pkgver> and -creates a new object c<$::tlpdb_netbin>. The argument is a reference of -the global C<%vars> hash. +list of additional platforms supported by the TeX Live server by reading +the remove TLPDB. The argument is a reference of the global C<%vars> hash. =cut sub additional_architectures_available_from_net { my $vars=shift; my @platforms; - my $database="$TeXLiveURL/$NetArchive/texlive.pkgver"; + my $location="$TeXLiveURL"; - tllog($::LOG_NORMAL, "Loading '$database' ...\n"); - my $wget = "wget"; - if (win32()) { - $wget = conv_to_win_path("$::installerdir/tlpkg/bin/wget.exe"); - } - open(WGET, "$wget -q --output-document=- $database|") or - tllog($::LOG_NORMAL, "Cannot load list of available archs from the net!\n"); - while (<WGET>) { - chop; - my $line=$_; - push @::pkgverlines,$line; - next unless /\s+-1$/; - ($platform, undef)=split " ", $line; + my $nettlpdb = TeXLive::TLPDB->new($location); + for my $platform ($nettlpdb->available_architectures) { unless (defined $vars->{"diskbin_$platform"}) { push @platforms, $platform; } } return @platforms; - close WGET; } =pod |