source: branches/1.4x/macosx/version.sh @ 7455

Last change on this file since 7455 was 7455, checked in by charles, 12 years ago

(1.4x libT) backport handshake, peer, bandwidth, peer-io to 1.4x.

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.7 KB
Line 
1#! /bin/sh
2#
3# $Id: version.sh 7455 2008-12-22 00:51:14Z charles $
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
10PEERID_PREFIX="-TR141X-"
11USERAGENT_PREFIX="1.41b4"
12
13SVN_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
19SVN_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
24if [ $SVN_REVISION_MAC -gt $SVN_REVISION ]
25then
26        SVN_REVISION=$SVN_REVISION_MAC
27fi
28 
29# Generate files to be included: only overwrite them if changed so make
30# won't rebuild everything unless necessary
31replace_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
41cat > 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
50EOF
51replace_if_differs libtransmission/version.h.new libtransmission/version.h
52
53exit 0
Note: See TracBrowser for help on using the repository browser.