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

Last change on this file since 7205 was 7205, checked in by livings124, 12 years ago

dirty fix to ensure the right svn number is grabbed

  • 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 7205 2008-11-30 17:45:14Z 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
10PEERID_PREFIX="-TR1400-"
11USERAGENT_PREFIX="1.40"
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
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 > SVN_REVISION; then
25        SVN_REVISION = SVN_REVISION_MAC
26fi
27 
28# Generate files to be included: only overwrite them if changed so make
29# won't rebuild everything unless necessary
30replace_if_differs ()
31{
32    if cmp $1 $2 > /dev/null 2>&1; then
33      rm -f $1
34    else
35      mv -f $1 $2
36    fi
37}
38
39# Generate version.h
40cat > libtransmission/version.h.new << EOF
41#define PEERID_PREFIX             "$PEERID_PREFIX"
42#define USERAGENT_PREFIX          "$USERAGENT_PREFIX"
43#define SVN_REVISION              "$SVN_REVISION"
44#define SHORT_VERSION_STRING      "$USERAGENT_PREFIX"
45#define LONG_VERSION_STRING       "$USERAGENT_PREFIX ($SVN_REVISION)"
46
47#define VERSION_STRING_INFOPLIST  $USERAGENT_PREFIX
48#define BUNDLE_VERSION_INFOPLIST  $SVN_REVISION
49EOF
50replace_if_differs libtransmission/version.h.new libtransmission/version.h
51
52exit 0
Note: See TracBrowser for help on using the repository browser.