This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new e16f0e0 Fetch artifact links first
e16f0e0 is described below
commit e16f0e01b442a908517969b9f210b261d84090f1
Author: Sebb <[email protected]>
AuthorDate: Sat Apr 18 23:53:19 2020 +0100
Fetch artifact links first
---
tools/download_check.rb | 40 ++++++++++++++++++++++++----------------
1 file changed, 24 insertions(+), 16 deletions(-)
diff --git a/tools/download_check.rb b/tools/download_check.rb
index 8a65146..18f4d33 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -372,24 +372,10 @@ def _checkDownloadPage(path, tlp, version)
# Check archives have hash and sig
vercheck = Hash.new() # key = archive name, value = array of hash/sig
+
links.each do |h,t|
- # Must occur before mirror check below
- if h =~
%r{^https?://(?:(?:archive\.|www\.)?apache\.org/dist|downloads\.apache.org)/(.+\.(asc|sha\d+|md5|sha))$}
- base = File.basename($1)
- ext = $2
- stem = base[0..-(2+ext.length)]
- if vercheck[stem]
- vercheck[stem] << ext
- else
- E "Bug: found hash #{h} for missing artifact #{stem}"
- end
- tmp = text2ext(t)
- next if ext == tmp # i.e. link is just the type or [TYPE]
- if not base == t and not t == 'checksum'
- E "Mismatch: #{h} and '#{t}'"
- end
# These might also be direct links to mirrors
- elsif h =~ ARTIFACT_RE
+ if h =~ ARTIFACT_RE
base = File.basename($1)
# puts "base: " + base
if vercheck[base] # might be two links to same archive
@@ -413,6 +399,26 @@ def _checkDownloadPage(path, tlp, version)
end
end
end
+
+ links.each do |h,t|
+ # Must occur before mirror check below
+ if h =~
%r{^https?://(?:(?:archive\.|www\.)?apache\.org/dist|downloads\.apache.org)/(.+\.(asc|sha\d+|md5|sha))$}
+ base = File.basename($1)
+ ext = $2
+ stem = base[0..-(2+ext.length)]
+ if vercheck[stem]
+ vercheck[stem] << ext
+ else
+ E "Bug: found hash #{h} for missing artifact #{stem}"
+ end
+ tmp = text2ext(t)
+ next if ext == tmp # i.e. link is just the type or [TYPE]
+ if not base == t and not t == 'checksum'
+ E "Mismatch: #{h} and '#{t}'"
+ end
+ end
+ end
+
# did we find all required elements?
vercheck.each do |k,v|
@@ -426,6 +432,8 @@ def _checkDownloadPage(path, tlp, version)
$NOFOLLOW = true
end
+ # Check if the links can be read
+
links.each do |h,t|
if h =~ %r{\.(asc|sha256|sha512)$}
host, stem, ext = check_hash_loc(h,tlp)