File: version

package info (click to toggle)
hare 0.24.2-4
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,756 kB
  • sloc: asm: 1,180; sh: 119; makefile: 116; lisp: 99
file content (22 lines) | stat: -rwxr-xr-x 414 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
#!/bin/sh
# Distro packagers may set the LOCALVER variable to add their distribution to
# the version, e.g. 1.0-alpine.
VERSION=${VERSION:0.24.2}

ver=$(git describe 2>/dev/null)
if [ $? -ne 0 ]
then
	ver="dev+$(git log -1 --format='%h' 2>/dev/null)"
	if [ $? -ne 0 ]
	then
		# git presumed unavailable
		ver=$VERSION
	fi
fi

localver=${LOCALVER:-}
if [ ${#localver} != 0 ]
then
	ver="$ver-$localver"
fi
echo $ver