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