]> git.saurik.com Git - wxWidgets.git/commitdiff
added a script to update release version field
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 21:34:48 +0000 (21:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 7 Jan 2007 21:34:48 +0000 (21:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/tech/tn0011.txt
misc/scripts/inc_release [new file with mode: 0755]

index 5037d99fce5652a05071ba565216a46a30988460..ef8d64bc5a64249e3ab1bcde7187a84b1515a884 100644 (file)
@@ -17,7 +17,9 @@
        {wx}/build/bakefiles/wxpresets/presets/wx_win32.bkl
        {wx}/build/script/win_docs.bat {windows doc and setup file}
        {wx}/distrib/scripts/build-environ.cfg {cvs tar and zip files}
+
+   The script misc/scripts/inc_release can be used for incrementing
+   the release field of the version, i.e. changing 2.8.x to 2.8.x+1.
 
 2. When to update the version numbers:
 
@@ -31,6 +33,9 @@
 Version: $Id$
 
 $Log$
+Revision 1.9  2007/01/07 21:34:40  VZ
+added a script to update release version field
+
 Revision 1.8  2006/11/12 20:13:09  VZ
 removed obsolete src/make*.env files
 
diff --git a/misc/scripts/inc_release b/misc/scripts/inc_release
new file mode 100755 (executable)
index 0000000..f151d10
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/sh
+##############################################################################
+# Name:       misc/scripts/inc_release
+# Purpose:    increments the release version number in all files mentioned in
+#             docs/tech/tn0011.txt
+# Created:    2007-01-07
+# RCS-ID:     $Id$
+# Copyright:  (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
+# Licence:    wxWindows licence
+##############################################################################
+
+error() {
+    echo "$progname: $*" >&2
+}
+
+msg() {
+    echo "$progname: $*"
+}
+
+run_sed() {
+    filename=$1
+    shift
+    cmd=
+    while [ $# -gt 0 ]; do
+        cmd="$cmd-e \"$1\" "
+        shift
+    done
+
+    msg "      updating $filename"
+    eval "sed -i $cmd $filename"
+}
+
+progname=`basename $0`
+
+# we must be run from wx directory
+if [ ! -f wxwin.m4 ]; then
+    error "must be ran from root wx directory"
+    exit 1
+fi
+
+# exit on any error
+set -e
+
+# the primary source of information is wx/version.h
+ver_string=`grep '#define wxVERSION_STRING ' include/wx/version.h | sed 's/^.*"wxWidgets \(.*\)")/\1/'`
+ver_major=`echo $ver_string | sed 's/\([0-9]\{1,\}\)\..*/\1/'`
+ver_minor=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)\..*/\1/'`
+ver_release=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)$/\1/'`
+
+msg "Original version is $ver_major.$ver_minor.$ver_release"
+
+ver_release_new=$(($ver_release + 1))
+ver_string_new=$ver_major.$ver_minor.$ver_release_new
+
+msg "Updating version to $ver_string_new"
+
+ver_for_sed="$ver_major\.$ver_minor\.$ver_release"
+
+run_sed include/wx/version.h \
+    "s/^\(#define wxRELEASE_NUMBER *\) $ver_release$/\1 $ver_release_new/" \
+    "s/^\(#define wxSUBRELEASE_NUMBER *\) [0-9]\{1,\}$/\1 0/"
+
+run_sed configure.in \
+    "/^AC_INIT/s/$ver_for_sed/$ver_string_new/" \
+    "s/^wx_release_number=$ver_release/wx_release_number=$ver_release_new/" \
+    "s/^wx_subrelease_number=.*$/wx_subrelease_number=0/"
+
+for f in *.spec; do
+    run_sed $f "/^%define *ver/s/$ver_for_sed/$ver_string_new/"
+done
+
+run_sed build/script/win_docs.bat "/SET WXW_VER=/s/$ver_for_sed/$ver_string_new/"