diff --git a/rc.changelog.rb b/rc.changelog.rb index 7dd99e1a1f76..7f3051b46119 100644 --- a/rc.changelog.rb +++ b/rc.changelog.rb @@ -1,4 +1,4 @@ -#!/bin/ruby +#!/usr/bin/ruby # The MIT License # # Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi @@ -22,42 +22,34 @@ # THE SOFTWARE. -# Updates changelog.html -# Usage: update.changelog.rb < changelog.html > output.html - -# version number manipulation class -class VersionNumber - def initialize(str) - @tokens = str.split(/\./) - end - def inc - @tokens[-1] = (@tokens[-1].to_i()+1).to_s() - end - def dec - @tokens[-1] = (@tokens[-1].to_i()-1).to_s() - end - def to_s - @tokens.join(".") - end -end - -id=VersionNumber.new(ARGV.shift) -id.inc() +# Moves the changelog from the trunk section to the release section +# Usage: rc.changelog.rb < changelog.html > output.html +changelog = [] +inside = false; ARGF.each do |line| - if /=BEGIN=/ =~ line + if /=TRUNK-BEGIN=/ =~ line + inside = true; puts line - puts "

What's new in #{id}

" + # new template puts "" - puts "" - next end - if /=END=/ =~ line + if /=TRUNK-END=/ =~ line + inside = false; + puts line + next + end + if inside + changelog << line + next + end + if /=RC-CHANGES=/ =~ line + changelog.each { |line| puts line } next end puts line -end \ No newline at end of file +end diff --git a/update.changelog.rb b/update.changelog.rb index 7dd99e1a1f76..5d7cd4cde92c 100644 --- a/update.changelog.rb +++ b/update.changelog.rb @@ -49,9 +49,7 @@ def to_s if /=BEGIN=/ =~ line puts line puts "

What's new in #{id}

" - puts "" + puts "" puts "" next @@ -60,4 +58,4 @@ def to_s next end puts line -end \ No newline at end of file +end