source: trunk/version.sh @ 459

Last change on this file since 459 was 436, checked in by titer, 16 years ago

Only put Transmission.app in the dmg

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author Id
File size: 1.1 KB
RevLine 
[262]1#! /bin/sh
2#
3# $Id: version.sh 436 2006-06-22 03:41:19Z livings124 $
4
[265]5# Get current SVN revision from Ids in all source files
[262]6REVMAX=0
[436]7for pattern in '*.[chm]' '*.cpp' '*.po' '*.mk' '*.in' 'Makefile' 'configure'; do
[266]8  for f in `find . -name "$pattern"`; do 
9    REV=`sed -e '/\$Id:/!d' -e \
[267]10         's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/' \
11         $f`
[262]12    if [ -n "$REV" ]; then
13      if [ "$REV" -gt "$REVMAX" ]; then
14        REVMAX="$REV"
15      fi
16    fi
17  done
18done
19
[265]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}
[262]30
[265]31# Generate version.mk
32cp -f mk/version.mk.in mk/version.mk.new
33echo "VERSION_REVISION = $REVMAX" >> mk/version.mk.new
34replace_if_differs mk/version.mk.new mk/version.mk
35
36# Generate version.h from version.mk
37grep "^VER" mk/version.mk | sed -e 's/^/#define /g' -e 's/= //g' \
38    -e 's/\(VERSION_STRING[ ]*\)\(.*\)/\1"\2"/' > \
39    libtransmission/version.h.new
40replace_if_differs libtransmission/version.h.new libtransmission/version.h
41
[262]42exit 0
Note: See TracBrowser for help on using the repository browser.