Author: particle
Date: Sat Mar 22 12:24:11 2008
New Revision: 26516

Added:
   trunk/tools/util/gen_release_info.pl
Modified:
   trunk/MANIFEST

Log:
[tools] add a new utility to generate release information suitable for charts, 
reports, etc.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Sat Mar 22 12:24:11 2008
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Mar 19 22:43:21 2008 UT
+# generated by C:\usr\local\parrot\trunk\tools\dev\mk_manifest_and_skip.pl Sat 
Mar 22 19:21:55 2008 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -3654,6 +3654,7 @@
 tools/docs/write_docs.pl                                    [devel]
 tools/install/smoke.pl                                      []
 tools/util/crow.pir                                         []
+tools/util/gen_release_info.pl                              []
 tools/util/ncidef2pasm.pl                                   []
 tools/util/perltidy.conf                                    []
 tools/util/pgegrep                                          []

Added: trunk/tools/util/gen_release_info.pl
==============================================================================
--- (empty file)
+++ trunk/tools/util/gen_release_info.pl        Sat Mar 22 12:24:11 2008
@@ -0,0 +1,54 @@
+#! perl
+use strict;
+use warnings;
+
+
+=head1 NAME
+
+tools/util/gen_release_info.pl - generate release info for graphs and charts
+
+=head1 DESCRIPTION
+
+This utility generates release information from subversion in csv format,
+suitable for graphs, charts, and reports.
+
+=cut
+
+
+my $repo_url = 'http://svn.perl.org/parrot/tags';
+
+##  ceate a release information data structure
+my $r = {
+    map { $_->{number} => $_ }
+    map { m{^(RELEASE_)(.*)/}
+            ? {
+                tag => "$1$2",
+                number => sub{$a = shift; $a =~ y/_/./; $a }->($2),
+            }
+            : ()
+        }
+    qx  { svn ls $repo_url }
+};
+
+##  gather interesting release-related information from the tag
+map {
+    ##  ask subversion for info about the tag
+    my $readme = $repo_url . '/' . $r->{$_}{tag};
+    warn "retrieving info on $readme\n";
+    my $info = qx{ svn info $readme };
+
+    ##  cull the interesting items
+    $info =~ m{Author: (\S+)} and $r->{$_}{author}   = $1;
+    $info =~ m{Rev: (\S+)}    and $r->{$_}{revision} = $1;
+    $info =~ m{Date: (\S+)}   and $r->{$_}{date}     = $1;
+} keys %$r;
+
+
+##  output info in csv format
+print
+    map { "$_\n" }
+    map { my $n = $_; join ',' =>
+        map { $r->{$n}{$_} || '' }
+        qw{ tag number author revision date  }
+    }
+    keys %$r;

Reply via email to