source: smplayer/trunk/get_svn_revision.sh@ 111

Last change on this file since 111 was 107, checked in by Silvan Scherrer, 15 years ago

smplayer: 0.6.9

File size: 887 bytes
Line 
1#!/bin/sh
2
3# This file is taken from the MPlayer sources, and adapted a little bit.
4# It gets the SVN revision number and then saves it in two files:
5# src/svn_revision.h and svn_revision
6
7test "$1" && extra="-$1"
8
9svn_revision=`LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
10test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
11test $svn_revision || svn_revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
12test $svn_revision || svn_revision=0UNKNOWN
13
14NEW_REVISION="#define SVN_REVISION \"SVN-r${svn_revision}${extra}\""
15OLD_REVISION=`cat src/svn_revision.h 2> /dev/null`
16
17# Update version.h only on revision changes to avoid spurious rebuilds
18if test "$NEW_REVISION" != "$OLD_REVISION"; then
19 echo "$NEW_REVISION" > src/svn_revision.h
20 echo "SVN-r${svn_revision}${extra}" > svn_revision
21fi
Note: See TracBrowser for help on using the repository browser.