source: trunk/macosx/version.sh @ 6191

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

(trunk) update appcast and version

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.8 KB
Line 
1#! /bin/sh
2#
3# $Id: version.sh 6191 2008-06-13 21:59:20Z 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="-TR122Z-"
11USERAGENT_PREFIX="1.22+"
12
13
14SVN_REVISION=`find ./ -name "*\.[chmp]" -o -name "*\.cpp" -o -name "*\.po" -o -name "*\.sh" | \
15              xargs grep "\$Id:" | \
16              grep -v third-party | \
17              cut -d"$Id:" -f3 | cut -d" " -f3 | sort -n | tail -n 1`
18
19if [[ "x${PEERID_PREFIX//0-/}" != "x$PEERID_PREFIX" ]]
20then
21    STABLE_RELEASE=yes
22else
23    STABLE_RELEASE=no
24fi
25 
26# Generate files to be included: only overwrite them if changed so make
27# won't rebuild everything unless necessary
28replace_if_differs ()
29{
30    if cmp $1 $2 > /dev/null 2>&1; then
31      rm -f $1
32    else
33      mv -f $1 $2
34    fi
35}
36
37# Generate version.mk
38cat > macosx/version.mk.new << EOF
39VERSION_REVISION    = "$SVN_REVISION"
40VERSION_STRING      = "$USERAGENT_PREFIX ($SVN_REVISION)"
41STABLE_RELEASE      = "$STABLE_RELEASE"
42EOF
43replace_if_differs macosx/version.mk.new macosx/version.mk
44
45# Generate version.h
46cat > libtransmission/version.h.new << EOF
47#define PEERID_PREFIX         "$PEERID_PREFIX"
48#define USERAGENT_PREFIX      "$USERAGENT_PREFIX"
49#define SVN_REVISION          "$SVN_REVISION"
50#define SHORT_VERSION_STRING  "$USERAGENT_PREFIX"
51#define LONG_VERSION_STRING   "$USERAGENT_PREFIX ($SVN_REVISION)"
52EOF
53replace_if_differs libtransmission/version.h.new libtransmission/version.h
54
55# Generate Info.plist from Info.plist.in
56sed -e "s/%%BUNDLE_VERSION%%/$SVN_REVISION/" -e "s/%%SHORT_VERSION_STRING%%/$USERAGENT_PREFIX/" \
57        < macosx/Info.plist.in > macosx/Info.plist.new
58replace_if_differs macosx/Info.plist.new macosx/Info.plist
59
60exit 0
Note: See TracBrowser for help on using the repository browser.