[gnumeric] tools: improve release tools.



commit 1fd34a777a31c180dcd2ac17e3265dfb399d15c2
Author: Morten Welinder <terra gnome org>
Date:   Fri May 7 19:56:58 2010 -0400

    tools: improve release tools.

 tools/ChangeLog       |    4 ++
 tools/release-do-CLog |   14 +++++---
 tools/release-do-bump |   88 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 101 insertions(+), 5 deletions(-)
---
diff --git a/tools/ChangeLog b/tools/ChangeLog
index efcfeb6..9577935 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-07  Morten Welinder <terra gnome org>
+
+	* release-do-bump: New tool for releasing.
+
 2010-04-16  Morten Welinder <terra gnome org>
 
 	* Release 1.10.2
diff --git a/tools/release-do-CLog b/tools/release-do-CLog
index 2afcf8c..25839e4 100755
--- a/tools/release-do-CLog
+++ b/tools/release-do-CLog
@@ -5,10 +5,13 @@ use strict;
 die "$0: must be run from top-level directory.\n"
     unless -r "configure.in" && -r 'ChangeLog';
 
-my $email = $ARGV[0];
-my $newversion = $ARGV[1];
-die "$0: you must supply an email address and the new version as argument.\n"
-    unless $email && $newversion;
+my $newversion = $ARGV[0];
+die "$0: you must supply the new version as argument.\n"
+    unless $newversion;
+
+my $email = $ENV{'EMAIL'};
+die "$0: you must define \$EMAIL.\n"
+    unless defined $email;
 
 my $name = $ENV{'NAME'};
 die "$0: you must define \$NAME.\n"
@@ -32,8 +35,9 @@ my @clogs = split ("\n", $clogstxt);
 foreach my $filename (sort @clogs) {
     my $dir = $filename;
     $dir =~ s|/ChangeLog$||;
+    my $fulldir = $dir;
     $dir =~ s|^\./||;
-    if ($exceptions{$dir}) {
+    if ($exceptions{$dir} || $fulldir =~ m{/tools/win32/}) {
 	print "Skipping $filename\n";
 	next;
     }
diff --git a/tools/release-do-bump b/tools/release-do-bump
new file mode 100644
index 0000000..28ad663
--- /dev/null
+++ b/tools/release-do-bump
@@ -0,0 +1,88 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+die "$0: must be run from top-level directory.\n"
+    unless -r "configure.in" && -r 'ChangeLog';
+
+my $email = $ENV{'EMAIL'};
+die "$0: you must define \$EMAIL.\n"
+    unless defined $email;
+
+my $name = $ENV{'NAME'};
+die "$0: you must define \$NAME.\n"
+    unless defined $name;
+
+my ($y,$m,$d) = (localtime (time))[5,4,3];
+$y += 1900;
+$m++;
+my $date = sprintf ("%04d-%02d-%02d", $y, $m, $d);
+
+# -----------------------------------------------------------------------------
+
+{
+    my $filename = 'configure.in';
+
+    local (*SRC);
+    local (*DST);
+
+    open (*SRC, "<$filename") || die "$0: failed to read $filename: $!\n";
+    open (*DST, ">$filename.tmp") || die "$0: failed to write $filename.tmp: $!\n";
+    foreach (<SRC>) {
+	if (/^(\s*m4_define\(\[\S*_version_minor\],\s*\[)(\d+)(\]\).*)/) {
+	    $_ = $1 . ($2 + 1) . $3 . "\n";
+	}
+	print DST;
+    }
+
+    close (*DST);
+    close (*SRC);
+
+    rename ("$filename.tmp", $filename);
+}
+
+# -----------------------------------------------------------------------------
+
+{
+    my $filename = 'NEWS';
+
+    local (*SRC);
+    local (*DST);
+
+    open (*SRC, "<$filename") || die "$0: failed to read $filename: $!\n";
+    open (*DST, ">$filename.tmp") || die "$0: failed to write $filename.tmp: $!\n";
+    my $first = 1;
+    foreach (<SRC>) {
+	if ($first) {
+	    $first = 0;
+	    die "[[[$_]]\n" unless /^(\S+\s+\d+\.\d+\.)(\d+)(.*)/;
+	    print DST "$1", ($2 + 1), "$3\n\n", ("-" x 74), "\n";
+	}
+	print DST;
+    }
+
+    close (*DST);
+    close (*SRC);
+
+    rename ("$filename.tmp", $filename);
+}
+
+# -----------------------------------------------------------------------------
+
+{
+    my $filename = 'ChangeLog';
+
+    my $entry = "$date  $name <$email>\n\n\t* configure.in: Post-release bump.\n\n";
+    local (*SRC);
+    local (*DST);
+
+    open (*SRC, "<$filename") || die "$0: failed to read $filename: $!\n";
+    open (*DST, ">$filename.tmp") || die "$0: failed to write $filename.tmp: $!\n";
+
+    print DST $entry;
+    foreach (<SRC>) { print DST; }
+    close (*DST);
+    close (*SRC);
+
+    rename ("$filename.tmp", $filename);
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]