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 6d03c8b5 Tidy up matched text
6d03c8b5 is described below
commit 6d03c8b53bba67c25e375ba460121978fb94652d
Author: Sebb <[email protected]>
AuthorDate: Thu Apr 25 13:01:04 2024 +0100
Tidy up matched text
---
tools/download_check.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/download_check.rb b/tools/download_check.rb
index b62d3135..c5c1fc06 100755
--- a/tools/download_check.rb
+++ b/tools/download_check.rb
@@ -488,8 +488,10 @@ def _checkDownloadPage(path, tlp, version)
hasGPGverify = false
# Check if GPG verify has two parameters
- body.scan(%r{^.+gpg --verify.+$}) { |m|
+ body.scan(%r{gpg --verify.+$}) { |m|
hasGPGverify = true
+ # Hack to tidy matched text: drop spans and truncate at <br> or <div>
+ m.gsub!(%r{<span [^>]+>|</span>}, '').sub!(%r{(<div|<br).+},'')
unless m =~ %r{gpg --verify\s+\S+\.asc\s+\S+}
W "gpg verify should specify second param: #{m.strip}
see:\nhttps://www.apache.org/info/verification.html#specify_both"
end