]> git.saurik.com Git - wxWidgets.git/blame - misc/scripts/inc_release
using #ifdef wxABORT_ON_CONFIG_ERROR not just #if as elsewhere
[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
78for f in *.spec; do
79 run_sed $f "/^%define *ver/s/$ver_for_sed/$ver_string_new/"
80done
81
6e3837d0
VZ
82run_sed build/osx/wxvers.xcconfig \
83 "/DYLIB_.* = /s/$ver_for_sed/$ver_string_new/"
84
0c63cc6e
VZ
85run_sed build/tools/bld_chm_exe.bat \
86 "/^SET WXW_VER=/s/$ver_for_sed/$ver_string_new/"
87
23818855
DS
88run_sed docs/readme.txt \
89 "/wxWidgets /s/$ver_for_sed/$ver_string_new/" \
90 "/\//s/$ver_for_sed/$ver_string_new/" \
91 "/naming: while/s/$ver_for_sed/$ver_string_new/"
92
ddb92955
VZ
93run_sed docs/doxygen/Doxyfile_inc \
94 "/^PROJECT_NUMBER/s/$ver_for_sed/$ver_string_new/"
6e3837d0 95
ddb92955 96run_sed docs/doxygen/latexdocstart.inc \
6e3837d0
VZ
97 "/\\large Version/s/$ver_for_sed/$ver_string_new/"
98
99run_sed include/wx/version.h \
100 "s/^\(#define wxRELEASE_NUMBER *\) $ver_release$/\1 $ver_release_new/" \
101 "s/^\(#define wxSUBRELEASE_NUMBER *\) [0-9]\{1,\}$/\1 0/" \
102 "/^#define wxVERSION_STRING/s/$ver_for_sed/$ver_string_new/"
103
104run_sed include/wx/osx/config_xcode.h \
105 "/^#define PACKAGE/s/$ver_for_sed/$ver_string_new/"
106
107run_sed samples/Info.plist \
108 "/version/s/$ver_for_sed/$ver_string_new/" \
109 "/<string>/s/$ver_for_sed/$ver_string_new/"
ddb92955 110
0c63cc6e
VZ
111run_sed samples/minimal/Info_carbon.plist \
112 "/<string>/s/$ver_for_sed/$ver_string_new/"
113run_sed samples/minimal/Info_cocoa.plist \
114 "/<string>/s/$ver_for_sed/$ver_string_new/"
115
6e3837d0
VZ
116run_sed samples/docview/Info.plist \
117 "/versionon/s/$ver_for_sed/$ver_string_new/" \
118 "/<string>/s/$ver_for_sed/$ver_string_new/"
9efbfd5d
VZ
119
120msg "Don't forget to change the C:R:A triplet in build/bakefiles/version.bkl now!"