2 # SPDX-License-Identifier: GPL-2.0
5 # This file is part of Lustre, http://www.lustre.org/
9 # Return lustre version string
12 DEFAULT_VERSION=2.15.55
13 LVF=LUSTRE-VERSION-FILE
18 if test -d ${GIT_DIR:-.git} -o -f .git &&
19 VN=$(git describe --match "[0-9]*" --abbrev=7 HEAD 2>/dev/null) &&
23 git update-index -q --refresh
24 test -z "$(git diff-index --name-only HEAD --)" ||
28 VN=$(echo "$VN" | sed -e 's/-/_/g');
31 VN=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF)
38 VC=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF)
42 test "$VN" = "$VC" || {
43 echo "LUSTRE_VERSION = $VN" >$LVF