summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-09 03:01:07 +0000
committerNorbert Preining <norbert@preining.info>2020-01-09 03:01:07 +0000
commit6ffc3e21c28ac83a308bf93982e8842d177dd23e (patch)
tree7e8b4d97bb1007e30decb7b64af7e746056daa4e /systems/texlive/tlnet/tlpkg/TeXLive
parent1b3f15203efd63cdab3fb47f37ff5f6c10558477 (diff)
CTAN sync 202001090301
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/TeXLive')
-rw-r--r--systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm23
1 files changed, 19 insertions, 4 deletions
diff --git a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
index 92a4aaaffc..72df5adeaa 100644
--- a/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
+++ b/systems/texlive/tlnet/tlpkg/TeXLive/TLUtils.pm
@@ -1,12 +1,12 @@
-# $Id: TLUtils.pm 53278 2019-12-31 18:46:04Z karl $
+# $Id: TLUtils.pm 53343 2020-01-07 10:55:10Z preining $
# TeXLive::TLUtils.pm - the inevitable utilities for TeX Live.
-# Copyright 2007-2019 Norbert Preining, Reinhard Kotucha
+# Copyright 2007-2020 Norbert Preining, Reinhard Kotucha
# This file is licensed under the GNU General Public License version 2
# or any later version.
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 53278 $';
+my $svnrev = '$Revision: 53343 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -1520,6 +1520,7 @@ sub install_packages {
$totalsize += $tlpsizes{$p};
}
my $starttime = time();
+ my @packs_again; # packages that we failed to download and should retry later
foreach my $package (@packs) {
my $tlpobj = $tlpobjs{$package};
my $reloc = $tlpobj->relocated;
@@ -1532,7 +1533,21 @@ sub install_packages {
foreach my $h (@::install_packages_hook) {
&$h($n,$totalnr);
}
- # return false if something went wrong
+ # push $package to @packs_again if download failed
+ if (!$fromtlpdb->install_package($package, $totlpdb)) {
+ tlwarn("TLUtils::install_packages: Failed to install $package\n"
+ ."Will be retried later.\n");
+ push @packs_again, $package;
+ } else {
+ $donesize += $tlpsizes{$package};
+ }
+ }
+ # try to download packages in @packs_again again
+ foreach my $package (@packs_again) {
+ my $infostr = sprintf("Retrying to install: $package [%dk]",
+ int($tlpsizes{$package}/1024) + 1);
+ info("$infostr\n");
+ # return false if download failed again
if (!$fromtlpdb->install_package($package, $totlpdb)) {
return 0;
}