[svn:parrot] r46729 - in trunk: . tools/util
gerd at svn.parrot.org
gerd at svn.parrot.org
Mon May 17 10:01:35 UTC 2010
Author: gerd
Date: Mon May 17 10:01:33 2010
New Revision: 46729
URL: https://trac.parrot.org/parrot/changeset/46729
Log:
Add a little program that can be used by the release manager to increment the version number
Added:
trunk/tools/util/inc_ver.pir (contents, props changed)
Modified:
trunk/MANIFEST
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Mon May 17 09:01:14 2010 (r46728)
+++ trunk/MANIFEST Mon May 17 10:01:33 2010 (r46729)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Sun May 16 20:16:37 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Mon May 17 09:44:33 2010 UT
#
# See below for documentation on the format of this file.
#
@@ -2145,6 +2145,7 @@
tools/util/crow.pir []
tools/util/dump_pbc.pl []
tools/util/gen_release_info.pl []
+tools/util/inc_ver.pir []
tools/util/ncidef2pasm.pl []
tools/util/parrot-config.pir []
tools/util/perlcritic-cage.conf []
Added: trunk/tools/util/inc_ver.pir
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/tools/util/inc_ver.pir Mon May 17 10:01:33 2010 (r46729)
@@ -0,0 +1,45 @@
+#!/usr/bin/env parrot
+# Copyright (C) 2010, Parrot Foundation.
+# $Id$
+
+.sub 'main' :main
+ .local string version_file_name
+ version_file_name = 'VERSION'
+ # read the version
+ $P0 = open version_file_name, 'r'
+ $S0 = readline $P0
+ close $P0
+
+ print 'version: '
+ print $S0
+
+ # split the version
+ $P0 = split '.', $S0
+
+ # increment version
+ $I0 = $P0[1]
+ inc $I0
+ if $I0 != 12 goto NOT_NILL
+ $I0 = $P0[0]
+ inc $I0
+ $P0[0] = $I0
+ $I0 = 0
+NOT_NILL:
+ $P0[1] = $I0
+
+ # join the version
+ $S0 = join '.', $P0
+
+ print 'new version: '
+ print $S0
+
+ $P0 = open version_file_name, 'w'
+ print $P0, $S0
+ close $P0
+.end
+
+# Local Variables:
+# mode: pir
+# fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4 ft=pir:
More information about the parrot-commits
mailing list