source: smplayer/trunk/get_svn_revision.sh@ 184

Last change on this file since 184 was 156, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to 0.8.6

File size: 1.0 KB
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" && LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2`
11test $svn_revision || svn_revision=`cd "$1" && grep revision .svn/entries 2>/dev/null | cut -d '"' -f2`
12test $svn_revision || svn_revision=`cd "$1" && sed -n -e '/^dir$/{n;p;q}' .svn/entries 2>/dev/null`
13test $svn_revision || svn_revision=0UNKNOWN
14
15if test "$2"; then
16extra="-$2"
17fi
18NEW_REVISION="#define SVN_REVISION \"${svn_revision}${extra}\""
19OLD_REVISION=`cat src/svn_revision.h 2> /dev/null`
20
21# Update version.h only on revision changes to avoid spurious rebuilds
22if test "$NEW_REVISION" != "$OLD_REVISION"; then
23 echo "$NEW_REVISION" > src/svn_revision.h
24 echo "SVN-r${svn_revision}${extra}" > svn_revision
25fi
Note: See TracBrowser for help on using the repository browser.