File: chversion.sh

package info (click to toggle)
poedit 1.4.2-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 6,688 kB
  • ctags: 1,229
  • sloc: cpp: 9,686; sh: 3,951; makefile: 269; ansic: 10
file content (35 lines) | stat: -rwxr-xr-x 843 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

if [ -z "$1" ] ; then
    echo "Usage: $0 \"version\"" >&2
    exit 1
fi

replace_ver()
{
    echo "replacing in $1..."
    echo "
,s@$2@$3@g
w
q
" | ed -s $1 2>/dev/null
}

VER_FULL=$1
VER_SHORT=`echo $VER_FULL | sed -e 's/pre[0-9]//g'`

replace_ver win32/poedit.iss \
            '\(#define VERSION_FULL *"\).*\("\)' "\1$VER_FULL\2"
replace_ver win32/poedit.iss \
            '\(#define VERSION *"\).*\("\)' "\1$VER_SHORT\2"
replace_ver configure.in \
            '\(AC_INIT(\[poedit\], \[\)[^]]*\(\],.*\)' "\1$VER_FULL\2"
replace_ver make-distrib.sh \
            '\(VERSION=\).*' "\1$VER_FULL"
replace_ver src/edapp.cpp \
            '\(wxString version(_T("\).*\("));\)' "\1$VER_SHORT\2"

for i in locales/*.po locales/*.pot ; do
    replace_ver $i \
                '\(Project-Id-Version:\)[^\\]*' "\1 Poedit $VER_SHORT"
done