Changeset 265 for trunk/version.sh


Ignore:
Timestamp:
May 31, 2006, 12:54:53 PM (16 years ago)
Author:
titer
Message:

Split and moved makefiles into a seperate folder, fixes and speed-up to
the retrieving of the SVN revision, OS X packages now show the revision
if this isn't a release build

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1 Makefile.config
        2 Makefile.version
        31.depend
        42build
  • trunk/version.sh

    r264 r265  
    33# $Id$
    44
     5# Get current SVN revision from Ids in all source files
    56REVMAX=0
    6 
    7 for pattern in '*.[chm]' '*.cpp' '*.po' 'Makefile*' 'configure'; do
    8   for f in `find . -name "$pattern"`; do
    9     REV=`grep '\$Id:' $f | sed 's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/'`
     7for pattern in '*.[chm]' '*.cpp' '*.po' '*.mk'; do
     8  for f in `find . -name "$pattern"` Makefile configure; do
     9    REV=`sed -e '/\$Id:/!d; s/.*\$Id$f`
    1010    if [ -n "$REV" ]; then
    1111      if [ "$REV" -gt "$REVMAX" ]; then
     
    1616done
    1717
    18 rm -f Makefile.version
    19 echo "VERSION_REVISION = $REVMAX" > Makefile.version
     18# Generate files to be included: only overwrite them if changed so make
     19# won't rebuild everything unless necessary
     20replace_if_differs ()
     21{
     22    if cmp $1 $2 > /dev/null 2>&1; then
     23      rm -f $1
     24    else
     25      mv -f $1 $2
     26    fi
     27}
     28
     29# Generate version.mk
     30cp -f mk/version.mk.in mk/version.mk.new
     31echo "VERSION_REVISION = $REVMAX" >> mk/version.mk.new
     32replace_if_differs mk/version.mk.new mk/version.mk
     33
     34# Generate version.h from version.mk
     35grep "^VER" mk/version.mk | sed -e 's/^/#define /g' -e 's/= //g' \
     36    -e 's/\(VERSION_STRING[ ]*\)\(.*\)/\1"\2"/' > \
     37    libtransmission/version.h.new
     38replace_if_differs libtransmission/version.h.new libtransmission/version.h
    2039
    2140exit 0
Note: See TracChangeset for help on using the changeset viewer.