Updated Branches: refs/heads/trunk a9636e246 -> 190974b51
GIRAPH-661: Munge symbols helper (nitay) Project: http://git-wip-us.apache.org/repos/asf/giraph/repo Commit: http://git-wip-us.apache.org/repos/asf/giraph/commit/190974b5 Tree: http://git-wip-us.apache.org/repos/asf/giraph/tree/190974b5 Diff: http://git-wip-us.apache.org/repos/asf/giraph/diff/190974b5 Branch: refs/heads/trunk Commit: 190974b5175252ff4c8ae53935f764a3d7b2f686 Parents: a9636e2 Author: Nitay Joffe <[email protected]> Authored: Tue May 7 13:08:59 2013 -0400 Committer: Nitay Joffe <[email protected]> Committed: Tue May 7 13:08:59 2013 -0400 ---------------------------------------------------------------------- CHANGELOG | 2 + dev-support/munge-table.rb | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/giraph/blob/190974b5/CHANGELOG ---------------------------------------------------------------------- diff --git a/CHANGELOG b/CHANGELOG index 05aa76a..07006f1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ Giraph Change Log Release 1.1.0 - unreleased + GIRAPH-661: Munge symbols helper (nitay) + GIRAPH-662: Incubator release should point to archived (aching) GIRAPH-655: Fix Hive Build for Hadoop 2.0.0 (nitay) http://git-wip-us.apache.org/repos/asf/giraph/blob/190974b5/dev-support/munge-table.rb ---------------------------------------------------------------------- diff --git a/dev-support/munge-table.rb b/dev-support/munge-table.rb new file mode 100755 index 0000000..1cb63ac --- /dev/null +++ b/dev-support/munge-table.rb @@ -0,0 +1,50 @@ +#!/usr/bin/env ruby +# +# To run this, first install nokogiri: "gem install nokogiri" + +require 'pp' +require 'set' + +require 'rubygems' +require 'nokogiri' +require 'open-uri' + +NAMESPACE = 'http://maven.apache.org/POM/4.0.0' + +doc = Nokogiri::XML(open("pom.xml")) + +profile_to_symbols = {} +symbol_to_profiles = {} +all_profile_ids = [] + +profiles = doc.xpath('//x:project/x:profiles/x:profile', 'x' => NAMESPACE) +profiles.each do |profile| + munge_symbols = profile.xpath('x:properties/x:munge.symbols', 'x' => NAMESPACE) + profile_id = profile.xpath('x:id', 'x' => NAMESPACE).text + all_profile_ids << profile_id + munge_symbols.text.split(',').each do |munge_symbol| + profile_to_symbols[profile_id] ||= Set.new + profile_to_symbols[profile_id] << munge_symbol + symbol_to_profiles[munge_symbol] ||= Set.new + symbol_to_profiles[munge_symbol] << profile_id + end +end + +max_length = symbol_to_profiles.keys.map { |x| x.length }.max +puts " " * (max_length+2) + all_profile_ids.join(' | ') +symbol_to_profiles.each_pair do |munge_symbol, profile_ids| + print "%-#{max_length}s |" % munge_symbol + all_profile_ids.each do |check_profile_id| + half_length = check_profile_id.length / 2 + space = " " * half_length + print space + if profile_ids.include?(check_profile_id) + print "x" + else + print " " + end + print " " if check_profile_id.length.odd? + print "#{space}| " + end + puts "" +end
