Add a --no-ftp mode to the release.pl download checks.

chiark's ftp server sometimes randomly refuses downloads. In the case
where this happens at postcheck time, this isn't really
release-blocking (all the files have been test-downloaded by precheck
already, so the main aim at this stage is to check that the 'latest'
symlink points to the right place, and even one or two successful
downloads are good enough to confirm that in practice). So now I can
add --no-ftp to the postcheck command line if that makes my life
easier.
This commit is contained in:
Simon Tatham 2017-07-08 09:23:51 +01:00
Родитель 7470e3bdaf
Коммит 0e2955ffbf
1 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -15,11 +15,13 @@ my $setver = 0;
my $upload = 0; my $upload = 0;
my $precheck = 0; my $precheck = 0;
my $postcheck = 0; my $postcheck = 0;
my $skip_ftp = 0;
GetOptions("version=s" => \$version, GetOptions("version=s" => \$version,
"setver" => \$setver, "setver" => \$setver,
"upload" => \$upload, "upload" => \$upload,
"precheck" => \$precheck, "precheck" => \$precheck,
"postcheck" => \$postcheck) "postcheck" => \$postcheck,
"no-ftp" => \$skip_ftp)
or &usage(); or &usage();
# --set-version: construct a local commit which updates the version # --set-version: construct a local commit which updates the version
@ -163,11 +165,13 @@ if ($precheck || $postcheck) {
} }
# Now test-download the files themselves. # Now test-download the files themselves.
my $ftpdata = `curl -s $ftp_uri`; unless ($skip_ftp) {
printf " got %d bytes via FTP", length $ftpdata; my $ftpdata = `curl -s $ftp_uri`;
die "FTP download for $ftp_uri did not match" printf " got %d bytes via FTP", length $ftpdata;
if $ftpdata ne $real_content; die "FTP download for $ftp_uri did not match"
print ", ok\n"; if $ftpdata ne $real_content;
print ", ok\n";
}
my $ua = LWP::UserAgent->new; my $ua = LWP::UserAgent->new;
my $httpresponse = $ua->get($http_uri); my $httpresponse = $ua->get($http_uri);