diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-29 23:34:24 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-29 23:34:24 +0000 |
commit | f1f7280f24a1c09df942f323d1008d631368690b (patch) | |
tree | 2b18c19150b5ef8b87a4e905343c1f89949910df /Build/source/texk/tests | |
parent | a309c2f2dd51f2c27ba409214cc6a68fe13c0849 (diff) |
sync
git-svn-id: svn://tug.org/texlive/trunk@30174 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tests')
-rw-r--r-- | Build/source/texk/tests/TeXLive/TLUtils.pm | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm index b5902c6ed12..fdcd482f5ba 100644 --- a/Build/source/texk/tests/TeXLive/TLUtils.pm +++ b/Build/source/texk/tests/TeXLive/TLUtils.pm @@ -5,7 +5,7 @@ package TeXLive::TLUtils; -my $svnrev = '$Revision: 29926 $'; +my $svnrev = '$Revision: 30127 $'; my $_modulerevision; if ($svnrev =~ m/: ([0-9]+) /) { $_modulerevision = $1; @@ -264,7 +264,7 @@ C</.*-(.*$)/> as a last resort and hope it provides something useful. sub platform_name { my ($guessed_platform) = @_; - $guessed_platform =~ s/^x86_64-(.*-k?)freebsd/amd64-$1freebsd/; + $guessed_platform =~ s/^x86_64-(.*-k?)(free|net)bsd/amd64-$1$2bsd/; my $CPU; # CPU type as reported by config.guess. my $OS; # O/S type as reported by config.guess. ($CPU = $guessed_platform) =~ s/(.*?)-.*/$1/; @@ -327,6 +327,7 @@ sub platform_desc { 'alpha-linux' => 'DEC Alpha with GNU/Linux', 'amd64-freebsd' => 'x86_64 with FreeBSD', 'amd64-kfreebsd' => 'x86_64 with GNU/kFreeBSD', + 'amd64-netbsd' => 'x86_64 with NetBSD', 'armel-linux' => 'ARM with GNU/Linux', 'armhf-linux' => 'ARMhf with GNU/Linux', 'hppa-hpux' => 'HP-UX', @@ -970,8 +971,11 @@ sub touch { if (-e $file) { utime time, time, $file; } else { - open TMP, ">>$file" && close TMP - or warn "Can't update timestamps of $file: $!\n"; + if (open( TMP, ">$file")) { + close(TMP); + } else { + warn "Can't create file $file: $!\n"; + } } } } @@ -2493,6 +2497,8 @@ sub download_file { } else { $url = "$TeXLiveURL/$relpath"; } + + my $wget_retry = 0; if (defined($::tldownload_server) && $::tldownload_server->enabled) { debug("persistent connection set up, trying to get $url (for $dest)\n"); $ret = $::tldownload_server->get_file($url, $dest); @@ -2500,8 +2506,10 @@ sub download_file { debug("downloading file via persistent connection succeeded\n"); return $ret; } else { - tlwarn("tlmgr: persistent connection ok, but download failed: $url\n"); - tlwarn("tlmgr: retrying with wget.\n"); + tlwarn("TLUtils::download_file: persistent connection ok," + . " but download failed: $url\n"); + tlwarn("TLUtils::download_file: retrying with wget.\n"); + $wget_retry = 1; # just so we can give another msg. } } else { if (!defined($::tldownload_server)) { @@ -2511,7 +2519,15 @@ sub download_file { } debug("persistent connection not set up, using wget\n"); } + + # try again. my $ret = _download_file($url, $dest, $wget); + + if ($wget_retry) { + tlwarn("TLUtils::download_file: retry with wget " + . ($ret ? "succeeded" : "failed") . ": $url\n"); + } + return($ret); } |