diff options
author | Norbert Preining <preining@logic.at> | 2016-01-06 04:20:37 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2016-01-06 04:20:37 +0000 |
commit | d812ffd4c5dc1b89dcf9593b8e426ab3a33b90a8 (patch) | |
tree | fe128d93c1a23e3ce3b9d9c5b0a25deee3bae70b | |
parent | 1736c6642dcc6ddfddb8338b2722aab914971b13 (diff) |
TLPDB: rename _install_package to _install_data, cater for size and checksum
git-svn-id: svn://tug.org/texlive/trunk@39286 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index 90738ee0d54..48fa71408dc 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -1404,9 +1404,9 @@ sub install_package_files { # # remove the RELOC prefix, but do NOT replace it with RelocTree @installfiles = map { s!^$TeXLive::TLConfig::RelocPrefix/!!; $_; } @installfiles; - # if the first argument of _install_package is scalar, it is the + # if the first argument of _install_data is scalar, it is the # place from where files should be installed - if (!_install_package ($tmpdir, \@installfiles, $reloc, \@installfiles, $self)) { + if (!_install_data ($tmpdir, \@installfiles, $reloc, \@installfiles, $self)) { tlwarn("TLPDB::install_package_files: couldn't install $what!\n"); next; } @@ -1535,18 +1535,16 @@ sub not_virtual_install_package { if ($media eq 'local_uncompressed') { $container = \@installfiles; } elsif ($media eq 'local_compressed') { - if (-r "$root/$Archive/$pkg.zip") { - $container = "$root/$Archive/$pkg.zip"; - } elsif (-r "$root/$Archive/$pkg.tar.xz") { + if (-r "$root/$Archive/$pkg.tar.xz") { $container = "$root/$Archive/$pkg.tar.xz"; } else { - tlwarn("TLPDB: cannot find package $pkg (.zip or .xz) in $root/$Archive\n"); + tlwarn("TLPDB: cannot find package $pkg.tar.xz) in $root/$Archive\n"); next; } } elsif (&media eq 'NET') { $container = "$root/$Archive/$pkg.$TeXLive::TLConfig::DefaultContainerExtension"; } - $self->_install_package ($container, $reloc, \@installfiles, $totlpdb) + $self->_install_data ($container, $reloc, \@installfiles, $totlpdb, $tlpobj->containersize, $tlpobj->containermd5) || return(0); # if we are installing from local_compressed or NET we have to fetch the respective # source and doc packages $pkg.source and $pkg.doc and install them, too @@ -1565,13 +1563,13 @@ sub not_virtual_install_package { if ($container_src_split && $opt_src && $tlpobj->srcfiles) { my $srccontainer = $container; $srccontainer =~ s/(\.tar\.xz|\.zip)$/.source$1/; - $self->_install_package ($srccontainer, $reloc, \@installfiles, $totlpdb) + $self->_install_data ($srccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->srccontainersize, $tlpob->srccontainermd5) || return(0); } if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) { my $doccontainer = $container; $doccontainer =~ s/(\.tar\.xz|\.zip)$/.doc$1/; - $self->_install_package ($doccontainer, $reloc, \@installfiles, $totlpdb) + $self->_install_data ($doccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->doccontainersize, $tlpobj->doccontainermd5) || return(0); } # @@ -1642,12 +1640,15 @@ sub not_virtual_install_package { } # -# _install_package +# _install_data # actually does the installation work # returns 1 on success and 0 on error # -sub _install_package { - my ($self, $what, $reloc, $filelistref, $totlpdb) = @_; +# if the first argument is a string, then files are taken from this directory +# otherwise it is a tlpdb from where to install +# +sub _install_data { + my ($self, $what, $reloc, $filelistref, $totlpdb, $whatsize, $whatcheck) = @_; my $target = $totlpdb->root; my $tempdir = "$target/temp"; @@ -1689,13 +1690,13 @@ sub _install_package { } # we always assume that copy will work return(1); - } elsif ($what =~ m,\.tar(\.xz)?$,) { + } elsif ($what =~ m,\.tar\.xz$,) { if ($reloc) { if (!$totlpdb->setting("usertree")) { $target .= "/$TeXLive::TLConfig::RelocTree"; } } - my $pkg = TeXLive::TLUtils::unpack($what, $target); + my $pkg = TeXLive::TLUtils::unpack($what, $target, 'size' => $whatsize, 'checksum' => $whatcheck); if (!$pkg) { tlwarn("TLPDB::_install_package: couldn't unpack $what to $target\n"); return(0); |