]>
Commit | Line | Data |
---|---|---|
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 | ||
11 | error() { | |
12 | echo "$progname: $*" >&2 | |
13 | } | |
14 | ||
15 | msg() { | |
16 | echo "$progname: $*" | |
17 | } | |
18 | ||
7bf32538 VZ |
19 | msgn() { |
20 | echo -n "$progname: $*" | |
21 | } | |
22 | ||
23 | msgc() { | |
24 | echo "$*" | |
25 | } | |
26 | ||
7de9aaf0 VZ |
27 | run_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 | ||
47 | progname=`basename $0` | |
48 | ||
49 | # we must be run from wx directory | |
50 | if [ ! -f wxwin.m4 ]; then | |
51 | error "must be ran from root wx directory" | |
52 | exit 1 | |
53 | fi | |
54 | ||
55 | # exit on any error | |
56 | set -e | |
57 | ||
58 | # the primary source of information is wx/version.h | |
59 | ver_string=`grep '#define wxVERSION_STRING ' include/wx/version.h | sed 's/^.*"wxWidgets \(.*\)")/\1/'` | |
60 | ver_major=`echo $ver_string | sed 's/\([0-9]\{1,\}\)\..*/\1/'` | |
61 | ver_minor=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)\..*/\1/'` | |
62 | ver_release=`echo $ver_string | sed 's/.*\.\([0-9]\{1,\}\)$/\1/'` | |
63 | ||
64 | msg "Original version is $ver_major.$ver_minor.$ver_release" | |
65 | ||
66 | ver_release_new=$(($ver_release + 1)) | |
67 | ver_string_new=$ver_major.$ver_minor.$ver_release_new | |
68 | ||
69 | msg "Updating version to $ver_string_new" | |
70 | ||
71 | ver_for_sed="$ver_major\.$ver_minor\.$ver_release" | |
72 | ||
7de9aaf0 VZ |
73 | run_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 |
78 | run_sed build/osx/wxvers.xcconfig \ |
79 | "/DYLIB_.* = /s/$ver_for_sed/$ver_string_new/" | |
80 | ||
0c63cc6e VZ |
81 | run_sed build/tools/bld_chm_exe.bat \ |
82 | "/^SET WXW_VER=/s/$ver_for_sed/$ver_string_new/" | |
83 | ||
23818855 DS |
84 | run_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 |
89 | run_sed docs/doxygen/Doxyfile_inc \ |
90 | "/^PROJECT_NUMBER/s/$ver_for_sed/$ver_string_new/" | |
6e3837d0 | 91 | |
ddb92955 | 92 | run_sed docs/doxygen/latexdocstart.inc \ |
6e3837d0 VZ |
93 | "/\\large Version/s/$ver_for_sed/$ver_string_new/" |
94 | ||
95 | run_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 | ||
100 | run_sed include/wx/osx/config_xcode.h \ | |
101 | "/^#define PACKAGE/s/$ver_for_sed/$ver_string_new/" | |
102 | ||
103 | run_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 |
107 | run_sed samples/minimal/Info_carbon.plist \ |
108 | "/<string>/s/$ver_for_sed/$ver_string_new/" | |
109 | run_sed samples/minimal/Info_cocoa.plist \ | |
110 | "/<string>/s/$ver_for_sed/$ver_string_new/" | |
111 | ||
6e3837d0 VZ |
112 | run_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 | |
116 | msg "Don't forget to change the C:R:A triplet in build/bakefiles/version.bkl now!" |