source: branches/0.8x/version.sh @ 3001

Last change on this file since 3001 was 3001, checked in by livings124, 15 years ago

(0.8x) update version to 0.82

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#! /bin/sh
2#
3# $Id$
4
5# constraint: strlen(MAJOR MINOR MAINT BETA) must be 4
6# convention: BETA: "Z" for a beta, "0" for a stable
7MAJOR="0"
8MINOR="8"
9MAINT="2"
10BETA="0"
11STRING=0.82
12
13PEERID_PREFIX="-TR0810-"
14USERAGENT_PREFIX="0.81"
15SVN_REVISION=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
16                     -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
17                     -o -name 'configure' ')' -exec cat '{}' ';' ) | \
18                   sed -e '/\$Id:/!d' -e \
19                     's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
20                   awk 'BEGIN { REV=0 }
21                              { if ( $1 > REV ) REV=$1 }
22                        END   { print REV }'`
23 
24# Generate files to be included: only overwrite them if changed so make
25# won't rebuild everything unless necessary
26replace_if_differs ()
27{
28    if cmp $1 $2 > /dev/null 2>&1; then
29      rm -f $1
30    else
31      mv -f $1 $2
32    fi
33}
34
35# Generate version.mk
36cat > mk/version.mk.new << EOF
37VERSION_MAJOR       = "$MAJOR"
38VERSION_MINOR       = "$MINOR"
39VERSION_MAINTENANCE = "$MAINT"
40VERSION_REVISION    = "$REV"
41VERSION_STRING      = "$STRING ($REV)"
42EOF
43replace_if_differs mk/version.mk.new mk/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.