1 | #! /bin/sh |
---|
2 | # |
---|
3 | # $Id: version.sh 7492 2008-12-24 17:41:10Z livings124 $ |
---|
4 | |
---|
5 | # convention: -TR MAJOR MINOR MAINT STATUS - (each a single char) |
---|
6 | # STATUS: "X" for prerelease test builds, |
---|
7 | # "Z" for unsupported trunk builds, |
---|
8 | # "0" for stable, supported releases |
---|
9 | # these should be the only two lines you need to change |
---|
10 | PEERID_PREFIX="-TR1420-" |
---|
11 | USERAGENT_PREFIX="1.42" |
---|
12 | |
---|
13 | SVN_REVISION=`find ./libtransmission -name "*\.[chmp]" -o -name "*\.cpp" -o -name "*\.po" -o -name "*\.sh" | \ |
---|
14 | xargs grep "\$Id:" | \ |
---|
15 | grep -v third-party | \ |
---|
16 | cut -d"$Id:" -f3 | cut -d" " -f3 | sort -n | tail -n 1` |
---|
17 | |
---|
18 | #dirty fix to ensure the highest version number is found when running release_builder.sh |
---|
19 | SVN_REVISION_MAC=`find ./macosx -name "*\.[chmp]" -o -name "*\.cpp" -o -name "*\.po" -o -name "*\.sh" | \ |
---|
20 | xargs grep "\$Id:" | \ |
---|
21 | grep -v third-party | \ |
---|
22 | cut -d"$Id:" -f3 | cut -d" " -f3 | sort -n | tail -n 1` |
---|
23 | |
---|
24 | if [ $SVN_REVISION_MAC -gt $SVN_REVISION ] |
---|
25 | then |
---|
26 | SVN_REVISION=$SVN_REVISION_MAC |
---|
27 | fi |
---|
28 | |
---|
29 | # Generate files to be included: only overwrite them if changed so make |
---|
30 | # won't rebuild everything unless necessary |
---|
31 | replace_if_differs () |
---|
32 | { |
---|
33 | if cmp $1 $2 > /dev/null 2>&1; then |
---|
34 | rm -f $1 |
---|
35 | else |
---|
36 | mv -f $1 $2 |
---|
37 | fi |
---|
38 | } |
---|
39 | |
---|
40 | # Generate version.h |
---|
41 | cat > libtransmission/version.h.new << EOF |
---|
42 | #define PEERID_PREFIX "$PEERID_PREFIX" |
---|
43 | #define USERAGENT_PREFIX "$USERAGENT_PREFIX" |
---|
44 | #define SVN_REVISION "$SVN_REVISION" |
---|
45 | #define SHORT_VERSION_STRING "$USERAGENT_PREFIX" |
---|
46 | #define LONG_VERSION_STRING "$USERAGENT_PREFIX ($SVN_REVISION)" |
---|
47 | |
---|
48 | #define VERSION_STRING_INFOPLIST $USERAGENT_PREFIX |
---|
49 | #define BUNDLE_VERSION_INFOPLIST $SVN_REVISION |
---|
50 | EOF |
---|
51 | replace_if_differs libtransmission/version.h.new libtransmission/version.h |
---|
52 | |
---|
53 | exit 0 |
---|