whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Only check spaces for main page
Date Tue, 06 Apr 2021 16:17:04 GMT
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 e63aa4d  Only check spaces for main page
e63aa4d is described below

commit e63aa4d3f666ca74ef9a23d9f195b0ded7d1444b
Author: Sebb <sebb@apache.org>
AuthorDate: Tue Apr 6 17:16:55 2021 +0100

    Only check spaces for main page
---
 tools/download_check.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index 1325c4b..7b12948 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -248,13 +248,13 @@ def check_hash_loc(h,tlp)
 end
 
 # get the https? links as Array of [href,text]
-def get_links(body)
+def get_links(body, checkSpaces=false)
   doc = Nokogiri::HTML(body)
   nodeset = doc.css('a[href]')    # Get anchors w href attribute via css
   nodeset.map { |node|
     tmp = node.attribute("href").to_s
     href = tmp.strip
-    if tmp != href
+    if checkSpaces && tmp != href
         W "Spurious space(s) in '#{tmp}'"
     end
     text = node.text.gsub(/[[:space:]]+/,' ').strip
@@ -374,7 +374,7 @@ def _checkDownloadPage(path, tlp, version)
 
   deprecated = Time.parse('2018-01-01')
 
-  links = get_links(body)
+  links = get_links(body, true)
   if links.size < 6 # source+binary * archive+sig+hash
     E "Page does not have enough links: #{links.size} < 6 -- perhaps it needs JavaScript?"
   end

Mime
View raw message