Last change
on this file since 1661 was
1661,
checked in by livings124, 16 years ago
|
add version info for maintenance number (z in x.y.z) and if dev build
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Date Rev Author Id
|
File size:
1.6 KB
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | # |
---|
3 | # $Id: version.sh 1661 2007-04-04 20:37:14Z livings124 $ |
---|
4 | |
---|
5 | MAJOR=0 |
---|
6 | MINOR=6 |
---|
7 | MAINT=1 |
---|
8 | |
---|
9 | # 0 for release, 1 otherwise |
---|
10 | DEV=1 |
---|
11 | |
---|
12 | STRING=0.7-svn |
---|
13 | |
---|
14 | # Get current SVN revision from Ids in all source files |
---|
15 | REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \ |
---|
16 | -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \ |
---|
17 | -o -name 'configure' ')' -exec cat '{}' ';' ) | \ |
---|
18 | sed -e '/\$Id:/!d' -e \ |
---|
19 | 's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' | |
---|
20 | awk 'BEGIN { REV=0 } |
---|
21 | // { if ( $1 > REV ) REV=$1 } |
---|
22 | END { print REV }'` |
---|
23 | |
---|
24 | # Generate files to be included: only overwrite them if changed so make |
---|
25 | # won't rebuild everything unless necessary |
---|
26 | replace_if_differs () |
---|
27 | { |
---|
28 | if cmp $1 $2 > /dev/null 2>&1; then |
---|
29 | rm -f $1 |
---|
30 | else |
---|
31 | mv -f $1 $2 |
---|
32 | fi |
---|
33 | } |
---|
34 | |
---|
35 | # Generate version.mk |
---|
36 | cat > mk/version.mk.new << EOF |
---|
37 | VERSION_MAJOR = $MAJOR |
---|
38 | VERSION_MINOR = $MINOR |
---|
39 | VERSION_MAINTENANCE = $MAINT |
---|
40 | VERSION_DEV = $DEV |
---|
41 | VERSION_STRING = $STRING |
---|
42 | VERSION_REVISION = $REV |
---|
43 | EOF |
---|
44 | replace_if_differs mk/version.mk.new mk/version.mk |
---|
45 | |
---|
46 | # Generate version.h |
---|
47 | cat > libtransmission/version.h.new << EOF |
---|
48 | #define VERSION_MAJOR $MAJOR |
---|
49 | #define VERSION_MINOR $MINOR |
---|
50 | #define VERSION_MAINTENANCE $MAINT |
---|
51 | #define VERSION_DEV $DEV |
---|
52 | #define VERSION_STRING "$STRING" |
---|
53 | #define VERSION_REVISION $REV |
---|
54 | EOF |
---|
55 | replace_if_differs libtransmission/version.h.new libtransmission/version.h |
---|
56 | |
---|
57 | # Generate Info.plist from Info.plist.in |
---|
58 | sed -e "s/%%BUNDLE_VERSION%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \ |
---|
59 | < macosx/Info.plist.in > macosx/Info.plist.new |
---|
60 | replace_if_differs macosx/Info.plist.new macosx/Info.plist |
---|
61 | |
---|
62 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.