File: git-version

package info (click to toggle)
strongswan 6.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 61,584 kB
  • sloc: ansic: 405,188; sh: 11,621; makefile: 6,254; sql: 2,885; javascript: 1,948; python: 990; xml: 608; perl: 586; cs: 522; lex: 485; yacc: 443; ruby: 398; ada: 114
file content (16 lines) | stat: -rwxr-xr-x 263 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

SRCDIR=$1
TARBALL=$SRCDIR/.tarball-git-version

if test -f $TARBALL; then
	V=$(cat $TARBALL)
elif test -e $SRCDIR/.git; then
	V=$(git -C $SRCDIR describe --exclude 'android-*' --tags HEAD 2>/dev/null)
fi

if test -z "$V"; then
	V="UNKNOWN"
fi

echo $V