source: trunk/mk/version.sh @ 2843

Last change on this file since 2843 was 2843, checked in by charles, 15 years ago

update version.sh to exclude third-party. add $Id:$ to the new files s.t. version.sh will find them.

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