source: trunk/version.sh @ 266

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

Grrr

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