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: Initial stab at validating Copyright and Trademarks
Date Thu, 27 Apr 2017 21:19:21 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  3c6ecfd   Initial stab at validating Copyright and Trademarks
3c6ecfd is described below

commit 3c6ecfd72b5542d2df6d0a2d9914b18c07d550d5
Author: Sebb <sebb@apache.org>
AuthorDate: Thu Apr 27 22:19:20 2017 +0100

    Initial stab at validating Copyright and Trademarks
---
 www/test/site-check.cgi | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/www/test/site-check.cgi b/www/test/site-check.cgi
index 41933e3..0410953 100755
--- a/www/test/site-check.cgi
+++ b/www/test/site-check.cgi
@@ -8,13 +8,16 @@ require 'wunderbar/jquery/stupidtable'
 require 'net/http'
 
 PAGETITLE = 'Apache TLP Website Link Checks'
-cols = %w( events foundation license sponsorship security thanks )
+cols = %w( events foundation license sponsorship security thanks copyright trademarks )
 DATAURI = 'https://whimsy.apache.org/public/site-scan.json'
 
 def analyze(sites)
     success = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
     counts = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
     { 
+      'copyright' => %r{Copyright [^.]+ Apache Software Foundation}i, # Do we need '[Tt]he
ASF'?
+      # TODO more checks needed here, e.g. ASF registered and 3rd party marks
+      'trademarks' => %r{trademarks of [Tt]he Apache Software Foundation}i,
       'events' => %r{apache.org/events/current-event}i,
       'license' => %r{apache.org/licenses/$}i, # should link to parent license page only
       'sponsorship' => %r{apache.org/foundation/sponsorship}i,
@@ -103,20 +106,20 @@ _html do
                 _a! "#{links['display_name']}", href: links['uri']
               end
               cols.each do |c|
+                if analysis[2].include? c and not analysis[2][c].include? n
+                    cls = 'label-warning'
+                else
+                    cls = '' # link not present or link OK
+                end
                 if not links[c]
                   _td ''
                 elsif links[c] =~ /^http/
                   _td do
-                    if ! analysis[2].include? c or analysis[2][c].include? n
-                      cls = '' # link not present or link OK
-                    else
-                      cls = 'label-warning'
-                    end
                     _a links[c].sub(/https?:\/\//, '').
                       sub(/(www\.)?apache\.org/i, 'a.o'), href: links[c], class: cls
                   end
                 else
-                  _td links[c]
+                  _td links[c].gsub(/Apache Software Foundation/,'ASF'), class: cls
                 end
               end
             end

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

Mime
View raw message