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 accb09d  Look for KEYS url first
accb09d is described below

commit accb09d94465acd60c5fe33ef1ad1f78c9a62c2d
Author: Sebb <[email protected]>
AuthorDate: Mon Dec 30 00:37:26 2019 +0000

    Look for KEYS url first
---
 tools/download_check.rb | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index 0d6f3f9..923538e 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -236,6 +236,7 @@ VERIFY_TEXT = [
  'verify your mirrored downloads',
  'verify your downloads',
  'All downloads should be verified',
+ 'verification instructions',
 ]
 
 ALIASES = {
@@ -308,21 +309,31 @@ def _checkDownloadPage(path, tlp, version)
   #   https://www.apache.org/dist/httpcomponents/httpclient/KEYS
   expurl = "https://[www.]apache.org/dist/[incubator/]#{tlp}/KEYS";
   expurlre = %r{^https://(www\.)?apache\.org/dist/(incubator/)?#{tlp}/KEYS$}
-  keys = links.select{|h,v| v.strip == 'KEYS' || v == 'KEYS file' || v == 
'[KEYS]'}
+  keys = links.select{|h,v| h =~ expurlre}
   if keys.size >= 1
-    I 'Found KEYS link'
-    keyurl = keys.first.first
-    if keyurl =~ expurlre
-      I "KEYS links to #{expurl} as expected"
+    keytext = keys.first[1]
+    if keytext == 'KEYS'
+        I 'Found KEYS link'
     else
-      if keyurl =~ %r{^https://www\.apache\.org/dist/#{tlp}/[^/]+/KEYS$}
-        W "KEYS: expected: #{expurl}\n             actual: #{keyurl}"
+        W "Found KEYS: '#{keytext}'"
+    end
+  else
+    keys = links.select{|h,v| v.strip == 'KEYS' || v == 'KEYS file' || v == 
'[KEYS]'}
+    if keys.size >= 1
+      I 'Found KEYS link'
+      keyurl = keys.first.first
+      if keyurl =~ expurlre
+        I "KEYS links to #{expurl} as expected"
       else
-        E "KEYS: expected: #{expurl}\n             actual: #{keyurl}"
+        if keyurl =~ %r{^https://www\.apache\.org/dist/#{tlp}/[^/]+/KEYS$}
+          W "KEYS: expected: #{expurl}\n             actual: #{keyurl}"
+        else
+          E "KEYS: expected: #{expurl}\n             actual: #{keyurl}"
+        end
       end
+    else
+      E 'Could not find KEYS link'
     end
-  else
-    E 'Could not find KEYS link'
   end
   
   # check for verify instructions

Reply via email to