~ubuntu-branches/debian/sid/mplayer/sid

« back to all changes in this revision

Viewing changes to version.sh

  • Committer: Bazaar Package Importer
  • Author(s): A Mennucc1
  • Date: 2009-03-23 10:05:45 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090323100545-x8h79obawnnte7kk
Tags: 1.0~rc2+svn20090303-5
debian/control : move docbook-xml,docbook-xsl,xsltproc from 
Build-Depends-Indep to Build-Depends, since they are needed to run
configure

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
echo "#define VERSION \"1.0rc2-$1\"" > version.h
3
 
echo "#define MP_TITLE \"MPlayer 1.0rc2-$1 (C) 2000-2007 MPlayer Team\"" >> version.h
 
2
 
 
3
test "$1" && extra="-$1"
 
4
 
 
5
# Extract revision number from file used by daily tarball snapshots
 
6
# or from the places different Subversion versions have it.
 
7
svn_revision=$(cat snapshot_version 2> /dev/null)
 
8
test $svn_revision || svn_revision=$(LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
 
9
test $svn_revision || svn_revision=$(grep revision .svn/entries 2>/dev/null | cut -d '"' -f2)
 
10
test $svn_revision || svn_revision=$(sed -n -e '/^dir$/{n;p;q;}' .svn/entries 2>/dev/null)
 
11
test $svn_revision || svn_revision=UNKNOWN
 
12
 
 
13
NEW_REVISION="#define VERSION \"SVN-r${svn_revision}${extra}\""
 
14
OLD_REVISION=$(cat version.h 2> /dev/null)
 
15
TITLE='#define MP_TITLE "%s "VERSION" (C) 2000-2009 MPlayer Team\n"'
 
16
 
 
17
# Update version.h only on revision changes to avoid spurious rebuilds
 
18
if test "$NEW_REVISION" != "$OLD_REVISION"; then
 
19
    cat <<EOF > version.h
 
20
$NEW_REVISION
 
21
$TITLE
 
22
EOF
 
23
fi