source: trunk/version.sh @ 1125

Last change on this file since 1125 was 1075, checked in by titer, 15 years ago

Clean up, generate Info.plist from version.sh as well

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.4 KB
RevLine 
[262]1#! /bin/sh
2#
3# $Id: version.sh 1075 2006-11-11 02:02:44Z livings124 $
4
[1075]5MAJOR=0
6MINOR=6
7STRING=0.7-svn
8
[265]9# Get current SVN revision from Ids in all source files
[1075]10REV=`( find . '(' -name '*.[chm]' -o -name '*.cpp' -o -name '*.po' \
[1036]11            -o -name '*.mk' -o -name '*.in' -o -name 'Makefile' \
12            -o -name 'configure' ')' -exec cat '{}' ';' ) | \
13          sed -e '/\$Id:/!d' -e \
14            's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' |
15          awk 'BEGIN { REV=0 }
16               //    { if ( $1 > REV ) REV=$1 }
17               END   { print REV }'`
18 
[265]19# Generate files to be included: only overwrite them if changed so make
20# won't rebuild everything unless necessary
21replace_if_differs ()
22{
23    if cmp $1 $2 > /dev/null 2>&1; then
24      rm -f $1
25    else
26      mv -f $1 $2
27    fi
28}
[262]29
[265]30# Generate version.mk
[1075]31cat > mk/version.mk.new << EOF
32VERSION_MAJOR    = $MAJOR
33VERSION_MINOR    = $MINOR
34VERSION_STRING   = $STRING
35VERSION_REVISION = $REV
36EOF
[265]37replace_if_differs mk/version.mk.new mk/version.mk
38
[1075]39# Generate version.h
40cat > libtransmission/version.h.new << EOF
41#define VERSION_MAJOR    $MAJOR
42#define VERSION_MINOR    $MINOR
43#define VERSION_STRING   "$STRING"
44#define VERSION_REVISION $REV
45EOF
[265]46replace_if_differs libtransmission/version.h.new libtransmission/version.h
47
[1075]48# Generate Info.plist from Info.plist.in
49sed -e "s/%%BUNDLE_VERSION%%/$REV/" -e "s/%%SHORT_VERSION_STRING%%/$STRING/" \
50        < macosx/Info.plist.in > macosx/Info.plist.new
51replace_if_differs macosx/Info.plist.new macosx/Info.plist
52
[262]53exit 0
Note: See TracBrowser for help on using the repository browser.