diff options
author | Norbert Preining <preining@logic.at> | 2016-01-07 02:44:29 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2016-01-07 02:44:29 +0000 |
commit | 18c1c1221143104b11e67232f8fc6511efb1cefb (patch) | |
tree | f44feb9bea4910c02b1585bba12d51adb74c2086 /Master/tlpkg/TeXLive/TLPDB.pm | |
parent | b8924faaece1872bb4ca583bbb205e15b21fe9ab (diff) |
revert changes in tlcritical to fix the TLDownload error
git-svn-id: svn://tug.org/texlive/trunk@39298 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLPDB.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLPDB.pm | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm index fa4c0965e51..90738ee0d54 100644 --- a/Master/tlpkg/TeXLive/TLPDB.pm +++ b/Master/tlpkg/TeXLive/TLPDB.pm @@ -1369,12 +1369,9 @@ sub install_package_files { # - create a tmp directory my $tmpdir = TeXLive::TLUtils::tl_tmpdir(); # - unpack everything there - { - my ($ret, $msg) = TeXLive::TLUtils::unpack($f, $tmpdir); - if (!$ret) { - tlwarn("TLPDB::install_package_files: $msg\n"); - next; - } + if (!TeXLive::TLUtils::unpack($f, $tmpdir)) { + tlwarn("TLPDB::install_package_files: couldn't install $f\n"); + next; } # we are still here, so the files have been unpacked properly # we need now to find the tlpobj in $tmpdir/tlpkg/tlpobj/ @@ -1407,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_data is scalar, it is the + # if the first argument of _install_package is scalar, it is the # place from where files should be installed - if (!_install_data ($tmpdir, \@installfiles, $reloc, \@installfiles, $self)) { + if (!_install_package ($tmpdir, \@installfiles, $reloc, \@installfiles, $self)) { tlwarn("TLPDB::install_package_files: couldn't install $what!\n"); next; } @@ -1538,16 +1535,18 @@ sub not_virtual_install_package { if ($media eq 'local_uncompressed') { $container = \@installfiles; } elsif ($media eq 'local_compressed') { - if (-r "$root/$Archive/$pkg.tar.xz") { + if (-r "$root/$Archive/$pkg.zip") { + $container = "$root/$Archive/$pkg.zip"; + } elsif (-r "$root/$Archive/$pkg.tar.xz") { $container = "$root/$Archive/$pkg.tar.xz"; } else { - tlwarn("TLPDB: cannot find package $pkg.tar.xz) in $root/$Archive\n"); + tlwarn("TLPDB: cannot find package $pkg (.zip or .xz) in $root/$Archive\n"); next; } } elsif (&media eq 'NET') { $container = "$root/$Archive/$pkg.$TeXLive::TLConfig::DefaultContainerExtension"; } - $self->_install_data ($container, $reloc, \@installfiles, $totlpdb, $tlpobj->containersize, $tlpobj->containermd5) + $self->_install_package ($container, $reloc, \@installfiles, $totlpdb) || 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 @@ -1566,13 +1565,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_data ($srccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->srccontainersize, $tlpobj->srccontainermd5) + $self->_install_package ($srccontainer, $reloc, \@installfiles, $totlpdb) || return(0); } if ($container_doc_split && $real_opt_doc && $tlpobj->docfiles) { my $doccontainer = $container; $doccontainer =~ s/(\.tar\.xz|\.zip)$/.doc$1/; - $self->_install_data ($doccontainer, $reloc, \@installfiles, $totlpdb, $tlpobj->doccontainersize, $tlpobj->doccontainermd5) + $self->_install_package ($doccontainer, $reloc, \@installfiles, $totlpdb) || return(0); } # @@ -1615,13 +1614,8 @@ sub not_virtual_install_package { # archives (.tar.xz) but at DVD install time we don't have them my $tlpod = $totlpdb->root . "/tlpkg/tlpobj"; mkdirhier( $tlpod ); - my $count = 0; - until (open(TMP,">$tlpod/".$tlpobj->name.".tlpobj")) { - # The open might fail for no good reason on Windows. - # Try again for a while, but not forever. - if ($count++ == 100) { die "$0: open($tlpobj_file) failed: $!"; } - select (undef, undef, undef, .1); # sleep briefly - } + open(TMP,">$tlpod/".$tlpobj->name.".tlpobj") or + die("Cannot open tlpobj file for ".$tlpobj->name); $tlpobj->writeout(\*TMP); close(TMP); $totlpdb->add_tlpobj($tlpobj); @@ -1648,15 +1642,12 @@ sub not_virtual_install_package { } # -# _install_data +# _install_package # actually does the installation work # returns 1 on success and 0 on error # -# 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) = @_; +sub _install_package { + my ($self, $what, $reloc, $filelistref, $totlpdb) = @_; my $target = $totlpdb->root; my $tempdir = "$target/temp"; @@ -1667,7 +1658,7 @@ sub _install_data { my $wget = $::progs{'wget'}; my $xzdec = TeXLive::TLUtils::quotify_path_with_spaces($::progs{'xzdec'}); if (!defined($wget) || !defined($xzdec)) { - tlwarn("TLPDB::_install_data: programs not set up properly; hmm.\n"); + tlwarn("TLPDB::_install_package: programs not set up properly; hmm.\n"); return(0); } @@ -1698,15 +1689,15 @@ sub _install_data { } # 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 ($ret, $pkg) = TeXLive::TLUtils::unpack($what, $target, 'size' => $whatsize, 'checksum' => $whatcheck); - if (!$ret) { - tlwarn("TLPDB::_install_package: $pkg\n"); + my $pkg = TeXLive::TLUtils::unpack($what, $target); + if (!$pkg) { + tlwarn("TLPDB::_install_package: couldn't unpack $what to $target\n"); return(0); } # remove the $pkg.tlpobj, we recreate it anyway again |