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 2019/10/21 21:30:54 UTC
[whimsy] branch master updated: Redundant;
page auto-updates from ci.json
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 51b61d9 Redundant; page auto-updates from ci.json
51b61d9 is described below
commit 51b61d9ed6680019f3e12063fcc404e51f517e89
Author: Sebb <se...@apache.org>
AuthorDate: Mon Oct 21 22:30:44 2019 +0100
Redundant; page auto-updates from ci.json
---
tools/update_chairs.rb | 88 --------------------------------------------------
1 file changed, 88 deletions(-)
diff --git a/tools/update_chairs.rb b/tools/update_chairs.rb
deleted file mode 100755
index 5a2ba82..0000000
--- a/tools/update_chairs.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/usr/bin/env ruby
-
-# @(#) Script to update foundation/index.txt list of chars from committee-info.json
-
-# Must be run locally at present, and the changes checked in manually
-
-$LOAD_PATH.unshift '/srv/whimsy/lib'
-
-require 'json'
-require 'open-uri'
-require 'whimsy/asf'
-
-cttees=JSON.parse(open('https://whimsy.apache.org/public/committee-info.json').read)['committees']
-chairs={}
-cttees.reject{|k,v| v['pmc'] == false}.each do|k,v|
- cttee=v['display_name']
- chairs[cttee]=v['chair'].first[1]['name']
-end
-
-idx=File.join(ASF::SVN['site-root'],'foundation','index.mdtext')
-
-puts "Updating #{idx} to latest copy"
-puts `svn update #{idx}`
-
-puts "Checking if any changes are needed"
-lines=[]
-first=nil # first line of chairs
-last=nil
-changes=[]
-seen=Hash.new{|h,k| h[k]=0}
-open(idx).each_line do |l|
-# | V.P., Apache Xalan | A. N. Other |
- m = l.match %r{^\| V.P., \[?Apache (.+?)(\]\(.+?\))? \| (.+?) \|}
- if m
- first ||= lines.length
- last = lines.length
- name,_,webchair = m.captures
- cichair = chairs[name]
- seen[name] += 1
- unless cichair
- puts "Cannot find CI entry for #{name}; dropping entry"
- changes << name
- next
- end
- if seen[name] > 1
- puts "Duplicate entry for #{name}; dropping"
- changes << name
- next
- end
- unless webchair == cichair
- puts "Changing chair for #{name} from #{webchair} to #{cichair}"
- lines << l.sub(webchair,cichair)
- changes << name
- next
- end
- end
- lines << l
-end
-
-notseen = (chairs.keys - seen.keys).sort
-if notseen.length > 0
- puts "No entry found for: " + notseen.join(',')
- notseen.each do |e|
- puts "Adding #{e}"
- lines.insert last, "| V.P., Apache #{e} | #{chairs[e]} |\n"
- changes << e
- end
- # N.B. Cannot use sort! on slice
- lines[first..last+notseen.length] = lines[first..last+notseen.length].sort_by do |l|
- l.match(/Apache +([^\]|]+)/) do |m|
- $1.downcase.gsub(' ','')
- end
- end
-end
-
-
-if changes.length > 0
- puts "Updating the file"
- File.open(idx,"w") do |f|
- lines.each {|line| f.print line}
- end
- puts "#{idx} was updated; check the diffs:"
- puts `svn diff #{idx}`
- puts "Copy/paste the next line to commit the change:"
- puts "svn ci -m'Changed chairs for: #{changes.join(',')}' #{idx}"
-else
- puts "#{idx} not changed"
-end
\ No newline at end of file