diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index a96df736414..14fbc8bc8cc 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -51,7 +51,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure TeXLive::TLUtils::create_fmtutil($tlpdb,$dest,$localconf); TeXLive::TLUtils::create_updmap($tlpdb,$dest,$localconf); TeXLive::TLUtils::create_language($tlpdb,$dest,$localconf); - TeXLive::TLUtils::install_packages($from_tlpdb,$to_tlpdb,@list); + TeXLive::TLUtils::install_packages($from_tlpdb,$to_tlpdb,$what, $netarchsref, $opt_src, $opt_doc)>); TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform); =head2 Miscellaneous @@ -104,14 +104,13 @@ BEGIN { &member &kpsewhich "ewords + &conv_to_win_path ); @EXPORT = qw(tllog); } -use TeXLive::TLConfig qw($DefaultContainerExtension); - - +use TeXLive::TLConfig; =pod @@ -541,10 +540,10 @@ sub install_packages { if (&media eq 'DVD') { $container = \@installfiles; } elsif (&media eq 'CD') { - if (-r "$::installerdir/$::diskarchive/$package.zip") { - $container = "$::installerdir/$::diskarchive/$package.zip"; - } elsif (-r "$::installerdir/$::diskarchive/$package.tar.lzma") { - $container = "$::installerdir/$::diskarchive/$package.tar.lzma"; + if (-r "$::installerdir/$DiskArchive/$package.zip") { + $container = "$::installerdir/$DiskArchive/$package.zip"; + } elsif (-r "$::installerdir/$DiskArchive/$package.tar.lzma") { + $container = "$::installerdir/$DiskArchive/$package.tar.lzma"; } else { # ok, it could be a binary package which should be installed from # the net @@ -552,19 +551,19 @@ sub install_packages { foreach my $a (@$netarchs) { if ($package =~ m/\.$a$/) { # ok this is a binary we should install from the net - $container = "$::texlive_url/$::netarchive/$package.$DefaultContainerExtension"; + $container = "$TeXLiveURL/$NetArchive/$package.$DefaultContainerExtension"; $donefromnet = 1; last; } } if (!$donefromnet) { # for now only warn and return, should (?) be die!? - warn "Cannot find a package $package (.zip or .lzma) in $::installerdir/$::diskarchive\n"; + warn "Cannot find a package $package (.zip or .lzma) in $::installerdir/$DiskArchive\n"; next; } } } elsif (&media eq 'NET') { - $container = "$::texlive_url/$::netarchive/$package.$DefaultContainerExtension"; + $container = "$TeXLiveURL/$NetArchive/$package.$DefaultContainerExtension"; } install_package($container,\@installfiles,$totlpdb->root,$vars{'this_platform'}); # if we are installing from CD or NET we have to fetch the respective @@ -704,7 +703,6 @@ sub install_package { } } - sub install_package_old { # either a list of files or a name of one .zip or .tar.lzma file. my @what=@_; @@ -734,7 +732,7 @@ sub install_package_old { copy "$file", "$target/$dn"; } } elsif (&media eq 'CD') { - my $package="$::installerdir/$::diskarchive/$what[0]"; + my $package="$::installerdir/$DiskArchive/$what[0]"; open IN, "$package", or warn "Can't open '$package': $!\n" or die "Can't open '$package': $!\n"; binmode IN; @@ -755,7 +753,7 @@ sub install_package_old { close OUT; close IN; } elsif (&media eq 'NET') { - my $package="$::texlive_url/$::netarchive/$what[0]"; + my $package="$TeXLiveURL/$NetArchive/$what[0]"; system "$wget $package|$lzmadec|$tar $target"; } else { die "This can't happen."; @@ -783,7 +781,7 @@ CD/DVD. sub media { unless (defined $::_media_) { - if (-d "$::installerdir/$::diskarchive") { + if (-d "$::installerdir/$DiskArchive") { $::_media_='CD'; } elsif (-d "$::installerdir/texmf/web2c") { $::_media_='DVD'; @@ -826,7 +824,7 @@ sub architectures_available { my @dir; my @platforms; if (&media eq "CD") { - opendir DIR, "$::installerdir/$::diskarchive"; + opendir DIR, "$::installerdir/$DiskArchive"; @dir=readdir DIR; chomp @dir; for (@dir) { @@ -855,7 +853,7 @@ sub architectures_available { 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<$::texlive_url/$::netarchive/texlive.pkgver> and +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. @@ -864,7 +862,7 @@ the global C<%vars> hash. sub additional_architectures_available_from_net { my $vars=shift; my @platforms; - my $database="$::texlive_url/$::netarchive/texlive.pkgver"; + my $database="$TeXLiveURL/$NetArchive/texlive.pkgver"; tllog($::LOG_NORMAL, "Loading '$database' ...\n"); my $wget = "wget"; @@ -1108,13 +1106,20 @@ writing permissions. sub texdir_check { my ($texdir) = shift; # PATH/texlive/2008 - return 1 if (win32()); my $texdirparent = dirname($texdir); # PATH/texlive my $texdirpparent = dirname($texdirparent); # PATH - if ( (-w $texdirpparent) || - ( (-d $texdirparent) && (-w $texdirparent) ) || - ( (-d $texdir) && (-w $texdir) ) ) { - return 1; + if (win32()) { + if ( (TeXLive::TLWinGoo::dir_writable($texdirpparent)) || + ( (-d $texdirparent) && (TeXLive::TLWinGoo::dir_writable($texdirparent)) ) || + ( (-d $texdir) && (TeXLive::TLWinGoo::dir_writable($texdir)) ) ) { + return 1; + } + } else { + if ( (-w $texdirpparent) || + ( (-d $texdirparent) && (-w $texdirparent) ) || + ( (-d $texdir) && (-w $texdir) ) ) { + return 1; + } } return 0; } |