/usr/src/openafs-1.6.1/build-tools/git-version is in openafs-modules-dkms 1.6.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 29 30 31 32 | #!/bin/sh
srcdir=$1
fallback=$2
if [ "x$fallback" = "x" ]; then
fallback=UNKNOWN
fi
if [ -f $srcdir/.version ] ; then
git_version=`cat $srcdir/.version`
else
if which git > /dev/null; then
cd $srcdir
git_version=`git describe --abbrev=4 HEAD 2>/dev/null`
if [ $? = 0 ]; then
# Is the working tree dirty?
if git diff-index --quiet --cached HEAD && \
git diff-files --quiet ; then
:
else
git_version="$git_version-dirty"
fi
else
git_version=$fallback
fi
else
git_version=$fallback
fi
fi
echo "$git_version" | sed -e 's/openafs-[^-]*-//' -e 's/_/./g' | tr -d '\012'
|