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 edbe42c  Add extra debug options
edbe42c is described below

commit edbe42c8992eea624de6e3717b437f25de5acd24
Author: Sebb <[email protected]>
AuthorDate: Tue Apr 13 15:45:46 2021 +0100

    Add extra debug options
---
 tools/download_check.rb | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/download_check.rb b/tools/download_check.rb
index 7b12948..023d13a 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -28,6 +28,8 @@ $ALWAYS_CHECK_LINKS = false
 $NO_CHECK_LINKS = false
 $NOFOLLOW = false # may be reset
 $ALLOW_HTTP = false # http links generate Warning, not Error
+$FAIL_FAST = false
+$SHOW_LINKS = false
 
 $VERSION = nil
 
@@ -61,7 +63,14 @@ end
 # save the result of a test
 def test(severity, txt)
   @tests << {severity => txt}
-  @fails +=1 unless severity == :I or severity == :W
+  unless severity == :I or severity == :W
+    @fails +=1
+    if $FAIL_FAST
+        puts txt
+        caller.each {|c| puts c}
+        exit!
+    end
+  end
 end
 
 def F(txt)
@@ -379,6 +388,10 @@ def _checkDownloadPage(path, tlp, version)
     E "Page does not have enough links: #{links.size} < 6 -- perhaps it needs 
JavaScript?"
   end
 
+  if $SHOW_LINKS
+    links.each {|l| p l}
+  end
+
   tlpQE = Regexp.escape(tlp) # in case of meta-chars
   # check KEYS link
   # TODO: is location used by hc allowed, e.g.
@@ -699,6 +712,8 @@ if __FILE__ == $0
   $NO_CHECK_LINKS = ARGV.delete '--nolinks'
   $ARCHIVE_CHECK = ARGV.delete '--archivecheck'
   $ALLOW_HTTP = ARGV.delete '--http'
+  $FAIL_FAST = ARGV.delete '--ff'
+  $SHOW_LINKS = ARGV.delete '--show-links'
 
   # check for any unhandled options
   ARGV.each do |arg|

Reply via email to