You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2016/04/05 19:00:12 UTC

[whimsy] branch master updated: Simpler way to check page order

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  56ef893   Simpler way to check page order
56ef893 is described below

commit 56ef89349d9db23ffd921ce9c1641b41e2ed59aa
Author: Sebb <se...@apache.org>
AuthorDate: Tue Apr 5 18:00:02 2016 +0100

    Simpler way to check page order
---
 tools/mirror_check.rb | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/mirror_check.rb b/tools/mirror_check.rb
index 07ff4a0..ca78aa4 100755
--- a/tools/mirror_check.rb
+++ b/tools/mirror_check.rb
@@ -141,21 +141,21 @@ def check_page(base, page, severity=:E, expectedStatus="200")
 end
 
 def checkIndex(page, type)
+  asfData = @pages[type]
+  links = parseIndexPage(page)
   if type == :tlps
-    fav = page.match('favicon.ico')
-    zzz = page.match('zzz/')
-    if fav.length == 1 and zzz.length == 1
-      if fav.begin(0) < zzz.begin(0)
+    fav = links.index('favicon.ico')
+    zzz = links.index('zzz')
+    if fav and zzz
+      if fav < zzz
         W "Incorrect page order - found favicon.ico before zzz/; folders should be listed before files"
       else
         I "Found favicon.ico and zzz/ in the page in the correct order (i.e. folders are listed before files)"
       end
     else
-      W "Expecting to find favicon.ico and zzz/ in the page"
+      W "Expecting to find favicon.ico #{fav} and zzz/ #{zzz} in the page"
     end
   end
-  asfData = @pages[type]
-  links = parseIndexPage(page)
   links.each {|l|
     W "Index #{type} the link #{l} is not shown on ASF site" unless asfData.include? l
   }

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <co...@whimsical.apache.org>'].