File: repo_version.sh

package info (click to toggle)
quickplot 0.10.3-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,464 kB
  • sloc: ansic: 16,640; sh: 11,163; makefile: 395
file content (26 lines) | stat: -rwxr-xr-x 358 bytes parent folder | download
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
#!/bin/sh

if test -z "$1" ; then
  echo "bad script $0 usage"
  exit 1
fi

ret="`(svnversion) 2>/dev/null`"
err="$?"

if test "X$err" != "X0" ; then
  ret=exported
elif test -z "$ret" ; then
  ret=unknown
fi

if test "X$ret" = "Xexported" ; then
  if test -f "$1" ; then
    out="`cat $1`"
    echo "$out"
  else
    echo "unknown"
  fi
else
  echo $ret
fi