summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-01-06 04:20:58 +0000
committerNorbert Preining <preining@logic.at>2016-01-06 04:20:58 +0000
commitb9692a77db3bdee4c01543716a26b999bf50bb7e (patch)
tree1ba8bc82c60850b529eaadc0a8d0ff467d119834 /Master
parente2f5e5a2e07cb0b8cbbfa906ffea944f21e0efc3 (diff)
TLUtils: remove install_package, replaced by TLPDB::install_package
git-svn-id: svn://tug.org/texlive/trunk@39289 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm168
1 files changed, 0 insertions, 168 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index a5888a02a87..d6bdcc27ea5 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -77,7 +77,6 @@ C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure
TeXLive::TLUtils::create_language_lua($tlpdb,$dest,$localconf);
TeXLive::TLUtils::time_estimate($totalsize, $donesize, $starttime)
TeXLive::TLUtils::install_packages($from_tlpdb,$media,$to_tlpdb,$what,$opt_src, $opt_doc)>);
- TeXLive::TLUtils::install_package($what, $filelistref, $target, $platform);
TeXLive::TLUtils::do_postaction($how, $tlpobj, $do_fileassocs, $do_menu, $do_desktop, $do_script);
TeXLive::TLUtils::announce_execute_actions($how, @executes, $what);
TeXLive::TLUtils::add_symlinks($root, $arch, $sys_bin, $sys_man, $sys_info);
@@ -1353,173 +1352,6 @@ sub install_packages {
return 1;
}
-
-=item C<install_package($what, $reloc, $size, $md5, $filelistref, $target, $platform)>
-
-This function installs the files given in @$filelistref from C<$what>
-into C<$target>.
-
-C<$size> gives the size in bytes of the container, or -1 if we are
-installing from uncompressed media, i.e., from a list of files to be copied.
-
-If C<$what> is a reference to a list of files then these files are
-assumed to be readable and are copied to C<$target>, creating dirs on
-the way. In this case the list C<@$filelistref> is not taken into
-account.
-
-If C<$what> starts with C<http://> or C<ftp://> then C<$what> is
-downloaded from the net and piped through C<xzdec> and C<tar>.
-
-If $what ends with C<.tar.xz> (but does not start with C<http://> or
-C<ftp://>, but possibly with C<file:/>) it is assumed to be a readable
-file on the system and is likewise piped through C<xzdec> and C<tar>.
-
-In both of these cases currently the list C<$@filelistref> currently
-is not taken into account (should be fixed!).
-
-if C<$reloc> is true the container (NET or local_compressed mode) is packaged in a way
-that the initial texmf-dist is missing.
-
-Returns 1 on success and 0 on error.
-
-=cut
-
-sub install_package {
- my ($what, $reloc, $whatsize, $whatmd5, $filelistref, $target, $platform) = @_;
-
- my @filelist = @$filelistref;
-
- my $tempdir = "$target/temp";
-
- # we assume that $::progs has been set up!
- my $wget = $::progs{'wget'};
- my $xzdec = quotify_path_with_spaces($::progs{'xzdec'});
- if (!defined($wget) || !defined($xzdec)) {
- tlwarn("install_package: wget/xzdec programs not set up properly.\n");
- return 0;
- }
- if (ref $what) {
- # we are getting a ref to a list of files, so install from uncompressed media
- my ($root, @files) = @$what;
- foreach my $file (@files) {
- # @what is taken, not @filelist!
- # is this still needed?
- my $dn=dirname($file);
- mkdirhier("$target/$dn");
- copy "$root/$file", "$target/$dn";
- }
- } elsif ($what =~ m,\.tar.xz$,) {
- # this is the case when we install from compressed media
- #
- # in all other cases we create temp files .tar.xz (or use the present
- # one), xzdec them, and then call tar
-
- # if we are unpacking a relocated container we adjust the target
- if ($reloc) {
- $target .= "/$TeXLive::TLConfig::RelocTree" if $reloc;
- mkdir($target) if (! -d $target);
- }
-
- my $fn = basename($what);
- my $pkg = $fn;
- $pkg =~ s/\.tar\.xz$//;
- mkdirhier("$tempdir");
- my $xzfile = "$tempdir/$fn";
- my $tarfile = "$tempdir/$fn"; $tarfile =~ s/\.xz$//;
- my $xzfile_quote = $xzfile;
- my $tarfile_quote = $tarfile;
- if (win32()) {
- $xzfile =~ s!/!\\!g;
- $tarfile =~ s!/!\\!g;
- $target =~ s!/!\\!g;
- }
- $xzfile_quote = "\"$xzfile\"";
- $tarfile_quote = "\"$tarfile\"";
- my $gotfiledone = 0;
- if (-r $xzfile) {
- # check that the downloaded file is not partial
- if ($whatsize >= 0) {
- # we have the size given, so check that first
- my $size = (stat $xzfile)[7];
- if ($size == $whatsize) {
- # we want to check also the md5sum if we have it present
- if ($whatmd5) {
- if (tlmd5($xzfile) eq $whatmd5) {
- $gotfiledone = 1;
- } else {
- tlwarn("Downloaded $what, size equal, but md5sum differs;\n",
- "downloading again.\n");
- }
- } else {
- # size ok, no md5sum
- tlwarn("Downloaded $what, size equal, but no md5sum available;\n",
- "continuing, with fingers crossed.");
- $gotfiledone = 1;
- }
- } else {
- tlwarn("Partial download of $what found, removing it.\n");
- unlink($tarfile, $xzfile);
- }
- } else {
- # ok no size information, hopefully we have md5 sums
- if ($whatmd5) {
- if (tlmd5($xzfile) eq $whatmd5) {
- $gotfiledone = 1;
- } else {
- tlwarn("Downloaded file, but md5sum differs, removing it.\n");
- }
- } else {
- tlwarn("Container found, but cannot verify size of md5sum;\n",
- "continuing, with fingers crossed.\n");
- $gotfiledone = 1;
- }
- }
- debug("Reusing already downloaded container $xzfile\n")
- if ($gotfiledone);
- }
- if (!$gotfiledone) {
- if ($what =~ m,http://|ftp://,) {
- # we are installing from the NET
- # download the file and put it into temp
- if (!download_file($what, $xzfile) || (! -r $xzfile)) {
- tlwarn("Downloading $what did not succeed.\n");
- return 0;
- }
- } else {
- # we are installing from local compressed media
- # copy it to temp
- copy($what, $tempdir);
- }
- }
- debug("un-xzing $xzfile to $tarfile\n");
- system("$xzdec < $xzfile_quote > $tarfile_quote");
- if (! -f $tarfile) {
- tlwarn("Unpacking $xzfile did not succeed.\n");
- return 0;
- }
- if (!TeXLive::TLUtils::untar($tarfile, $target, 1)) {
- tlwarn("untarring $tarfile failed, stopping install.\n");
- return 0;
- }
- # we remove the created .tlpobj it is recreated anyway in
- # install_packages above in the right place. This way we also
- # get rid of the $pkg.source.tlpobj which are useless
- unlink ("$target/tlpkg/tlpobj/$pkg.tlpobj")
- if (-r "$target/tlpkg/tlpobj/$pkg.tlpobj");
- if ($what =~ m,http://|ftp://,) {
- # we downloaded the original .tar.lzma from the net, so we keep it
- } else {
- # we are downloading it from local compressed media, so we can unlink it to save
- # disk space
- unlink($xzfile);
- }
- } else {
- tlwarn("Sorry, no idea how to install $what\n");
- return 0;
- }
- return 1;
-}
-
=item C<do_postaction($how, $tlpobj, $do_fileassocs, $do_menu, $do_desktop, $do_script)>
Evaluates the C<postaction> fields in the C<$tlpobj>. The first parameter