source: trunk/version.sh @ 1819

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

update trunk version

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.5 KB
Line 
1#! /bin/sh
2#
3# $Id: version.sh 1819 2007-04-30 15:44:54Z livings124 $
4
5MAJOR=0
6MINOR=7
7MAINT=2
8STRING=0.80-svn
9
10# Get current SVN revision from Ids in all source files
11REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
12            -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
13            -o -name 'configure' ')' -exec cat '{}' ';' ) | \
14          sed -e '/\$Id:/!d' -e \
15            's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
16          awk 'BEGIN { REV=0 }
17               //    { if ( $1 > REV ) REV=$1 }
18               END   { print REV }'`
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_STRING      = $STRING
37VERSION_REVISION    = $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 VERSION_MAJOR       $MAJOR
44#define VERSION_MINOR       $MINOR
45#define VERSION_MAINTENANCE $MAINT
46#define VERSION_STRING      "$STRING"
47#define VERSION_REVISION    $REV
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%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \
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.