source: trunk/macosx/version.sh @ 7961

Last change on this file since 7961 was 7961, checked in by livings124, 13 years ago

update trunk to 1.51+

  • 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 7961 2009-02-27 00:47:54Z livings124 $
4
5# convention: -TR MAJOR MINOR MAINT STATUS - (each a single char)
6# STATUS: "X" for prerelease beta 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
10PEERID_PREFIX="-TR151Z-"
11USERAGENT_PREFIX="1.51+"
12
13SVN_REVISION=`find -E ./libtransmission ./macosx                     \
14                  -regex ".*\.([chmp]|cpp|po|sh)"                    \
15                  -exec grep -oh '\$Id: [^ ]\+ [0-9]\+' {} +         \
16                  | awk '{ if ($3 > max) max = $3} END { print max }'`
17
18# Generate files to be included: only overwrite them if changed so make
19# won't rebuild everything unless necessary
20replace_if_differs ()
21{
22    if cmp $1 $2 > /dev/null 2>&1; then
23      rm -f $1
24    else
25      mv -f $1 $2
26    fi
27}
28
29# Generate version.h
30cat > libtransmission/version.h.new << EOF
31#define PEERID_PREFIX             "$PEERID_PREFIX"
32#define USERAGENT_PREFIX          "$USERAGENT_PREFIX"
33#define SVN_REVISION              "$SVN_REVISION"
34#define SHORT_VERSION_STRING      "$USERAGENT_PREFIX"
35#define LONG_VERSION_STRING       "$USERAGENT_PREFIX ($SVN_REVISION)"
36
37#define VERSION_STRING_INFOPLIST  $USERAGENT_PREFIX
38#define BUNDLE_VERSION_INFOPLIST  $SVN_REVISION
39EOF
40
41# Add a release definition
42if [ ${PEERID_PREFIX:6:1} = X ]; then
43    line='#define TR_BETA_RELEASE     "BETA"'
44elif [ ${PEERID_PREFIX:6:1} = Z ]; then
45    line='#define TR_NIGHTLY_RELEASE  "NIGHTLY"'
46else
47    line='#define TR_STABLE_RELEASE   "STABLE"'
48fi
49echo $line >> libtransmission/version.h.new
50
51replace_if_differs libtransmission/version.h.new libtransmission/version.h
52
53exit 0
Note: See TracBrowser for help on using the repository browser.