MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / scripts / setlocalversion
blob82e4993f0a7368797989b2acd169fe203766fb7a
1 #!/bin/sh
2 # Print additional version information for non-release trees.
4 usage() {
5 echo "Usage: $0 [srctree]" >&2
6 exit 1
9 cd "${1:-.}" || usage
11 # Check for git and a git repo.
12 if head=`git rev-parse --verify HEAD 2>/dev/null`; then
13 # Do we have an untagged version?
14 if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
15 printf '%s%s' -g `echo "$head" | cut -c1-8`
18 # Are there uncommitted changes?
19 if git diff-index HEAD | read dummy; then
20 printf '%s' -dirty