File: getversion

package info (click to toggle)
munin 1.4.5-3%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 4,988 kB
  • ctags: 806
  • sloc: perl: 8,936; sh: 3,105; java: 1,754; makefile: 585; python: 143
file content (28 lines) | stat: -rwxr-xr-x 543 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Be compatible here, use `` and such old stuff

VERSION=`cat RELEASE`

if ls -d .svn > /dev/null 2>&1; then
    INFO_CMD="svn info"
elif ls -d .git > /dev/null 2>&1; then
    if which git-svn > /dev/null 2>&1; then
        INFO_CMD="git-svn info"
    else
        INFO_CMD="git svn info"
    fi
else
    INFO_CMD="echo Revision: <UNKNOWN>"
fi

case $VERSION in
    svn-*)
	R=`$INFO_CMD | awk '/^Revision: / { print $2; }'` || {
	    echo Unable to get svn revision >&2
	    exit 1
	}
	VERSION="$VERSION-r$R"
	;;
esac

echo $VERSION