]> git.saurik.com Git - wxWidgets.git/blame - misc/scripts/inc_release
Somehow, setting a tint color makes gauge work :/.
[wxWidgets.git] / misc / scripts / inc_release
CommitLineData
7de9aaf0
VZ
1#!/bin/sh
2##############################################################################
3# Name: misc/scripts/inc_release
4# Purpose: increments the release version number in all files mentioned in
5# docs/tech/tn0011.txt
6# Created: 2007-01-07
7de9aaf0
VZ
7# Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
8# Licence: wxWindows licence
9##############################################################################
10
11error() {
12 echo "$progname: $*" >&2
13}
14
15msg() {
16 echo "$progname: $*"
17}
18
7bf32538
VZ
19msgn() {
20 echo -n "$progname: $*"
21}
22
23msgc() {
24 echo "$*"
25}
26
7de9aaf0
VZ
27run_sed() {
28 filename=$1
29 shift
30 cmd=
31 while [ $# -gt 0 ]; do
32 cmd="$cmd-e \"$1\" "
33 shift
34 done
35
7bf32538
VZ
36 msgn " processing $filename ... "
37 eval "sed $cmd $filename" > $filename.$$
38 if cmp -s $filename $filename.$$; then
39 rm $filename.$$
40 msgc "unchanged"
41 else
42 mv $filename.$$ $filename
43 msgc "done"
44 fi
7de9aaf0
VZ
45}
46
47progname=`basename $0`
48
49# we must be run from wx directory
50if [ ! -f wxwin.m4 ]; then
51 error "must be ran from root wx directory"
52 exit 1
53fi
54
55# exit on any error
56set -e
57
58# the primary source of information is wx/version.h
59ver_string=`grep '#define wxVERSION_STRING ' include/wx/version.h | sed 's/^.*"wxWidgets \(.*\)")/\1/'`
60ver_major=`echo $ver_string | sed 's/\([0-9]\{1,\}\)\..*/\1/'`
61ver_minor=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)\..*/\1/'`
62ver_release=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)$/\1/'`
63
64msg "Original version is $ver_major.$ver_minor.$ver_release"
65
66ver_release_new=$(($ver_release + 1))
67ver_string_new=$ver_major.$ver_minor.$ver_release_new
68
69msg "Updating version to $ver_string_new"
70
71ver_for_sed="$ver_major\.$ver_minor\.$ver_release"
72
7de9aaf0
VZ
73run_sed configure.in \
74 "/^AC_INIT/s/$ver_for_sed/$ver_string_new/" \
75 "s/^wx_release_number=$ver_release/wx_release_number=$ver_release_new/" \
76 "s/^wx_subrelease_number=.*$/wx_subrelease_number=0/"
77
6e3837d0
VZ
78run_sed build/osx/wxvers.xcconfig \
79 "/DYLIB_.* = /s/$ver_for_sed/$ver_string_new/"
80
0c63cc6e
VZ
81run_sed build/tools/bld_chm_exe.bat \
82 "/^SET WXW_VER=/s/$ver_for_sed/$ver_string_new/"
83
23818855
DS
84run_sed docs/readme.txt \
85 "/wxWidgets /s/$ver_for_sed/$ver_string_new/" \
86 "/\//s/$ver_for_sed/$ver_string_new/" \
87 "/naming: while/s/$ver_for_sed/$ver_string_new/"
88
ddb92955
VZ
89run_sed docs/doxygen/Doxyfile_inc \
90 "/^PROJECT_NUMBER/s/$ver_for_sed/$ver_string_new/"
6e3837d0 91
ddb92955 92run_sed docs/doxygen/latexdocstart.inc \
6e3837d0
VZ
93 "/\\large Version/s/$ver_for_sed/$ver_string_new/"
94
95run_sed include/wx/version.h \
96 "s/^\(#define wxRELEASE_NUMBER *\) $ver_release$/\1 $ver_release_new/" \
97 "s/^\(#define wxSUBRELEASE_NUMBER *\) [0-9]\{1,\}$/\1 0/" \
98 "/^#define wxVERSION_STRING/s/$ver_for_sed/$ver_string_new/"
99
100run_sed include/wx/osx/config_xcode.h \
101 "/^#define PACKAGE/s/$ver_for_sed/$ver_string_new/"
102
103run_sed samples/Info.plist \
104 "/version/s/$ver_for_sed/$ver_string_new/" \
105 "/<string>/s/$ver_for_sed/$ver_string_new/"
ddb92955 106
0c63cc6e
VZ
107run_sed samples/minimal/Info_carbon.plist \
108 "/<string>/s/$ver_for_sed/$ver_string_new/"
109run_sed samples/minimal/Info_cocoa.plist \
110 "/<string>/s/$ver_for_sed/$ver_string_new/"
111
6e3837d0
VZ
112run_sed samples/docview/Info.plist \
113 "/versionon/s/$ver_for_sed/$ver_string_new/" \
114 "/<string>/s/$ver_for_sed/$ver_string_new/"
9efbfd5d
VZ
115
116msg "Don't forget to change the C:R:A triplet in build/bakefiles/version.bkl now!"