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 3d8a0aa Allow for links to archive server
3d8a0aa is described below
commit 3d8a0aa051d6ea520fba94ee75eb2ba30d9dea5d
Author: Sebb <[email protected]>
AuthorDate: Thu Jan 2 19:34:37 2020 +0000
Allow for links to archive server
---
tools/download_check.rb | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/download_check.rb b/tools/download_check.rb
index bcb49bc..513b70f 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -248,7 +248,7 @@ ALIASES = {
# e.g. SHA256 => sha256; [SIG] => asc
def text2ext(txt)
if txt.size <= 10
- tmp = txt.downcase.sub(%r{^\[(.+)\]$},'\1')
+ tmp = txt.downcase.sub(%r{^\[(.+)\]$},'\1').sub('-','')
ALIASES[tmp] || tmp
else
txt
@@ -360,7 +360,7 @@ def _checkDownloadPage(path, tlp, version)
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?://www.apache.org/dist/(.+\.(asc|sha\d+|md5))$}
+ if h =~
%r{^https?://(?:archive|www)\.apache\.org/dist/(.+\.(asc|sha\d+|md5))$}
base = File.basename($1)
ext = $2
stem = base[0..-(2+ext.length)]
@@ -386,11 +386,13 @@ def _checkDownloadPage(path, tlp, version)
# Text must include a '.' (So we don't check 'Source')
if t.include?('.') and not base == t
# text might be short version of link
- tmp = t.strip.sub(%r{.*/},'') #
+ tmp = t.strip.sub(%r{.*/},'').downcase #
if base == tmp
W "Mismatch?: #{h} and #{t}"
+ elsif base.end_with? tmp
+ W "Mismatch?: #{h} and '#{tmp}'"
else
- E "Mismatch: #{h} and '#{tmp}'"
+ E "Mismatch2: #{h} and '#{tmp}'"
end
end
end