X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=LUSTRE-VERSION-GEN;h=db06e1c10b6151516ae0ce88d7485ae1ecf47f9c;hp=b21eb568aa0877c35817166e86d41cfd8292b1af;hb=HEAD;hpb=0a2264a956b980fb25c45690680c51d86332e940 diff --git a/LUSTRE-VERSION-GEN b/LUSTRE-VERSION-GEN index b21eb56..90ad3ab 100755 --- a/LUSTRE-VERSION-GEN +++ b/LUSTRE-VERSION-GEN @@ -1,37 +1,46 @@ -#!/bin/sh +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0 -DEFAULT_VERSION=2.9.58 +# +# This file is part of Lustre, http://www.lustre.org/ +# +# LUSTRE-VERSION-GEN +# +# Return lustre version string +# + +DEFAULT_VERSION=2.15.62 LVF=LUSTRE-VERSION-FILE LF=' ' if test -d ${GIT_DIR:-.git} -o -f .git && - VN=$(git describe --match "[0-9]*" --abbrev=7 HEAD 2>/dev/null) && - case "$VN" in - *$LF*) (exit 1) ;; - [0-9]*) - git update-index -q --refresh - test -z "$(git diff-index --name-only HEAD --)" || - VN="$VN-dirty" ;; - esac + VN=$(git describe --match "[0-9]*" --abbrev=7 HEAD 2>/dev/null) && + case "$VN" in + *$LF*) (exit 1) ;; + [0-9]*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" ;; + esac then - VN=$(echo "$VN" | sed -e 's/-/_/g'); + VN=$(echo "$VN" | sed -e 's/-/_/g'); elif test -r $LVF then - VN=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) + VN=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) else - VN="$DEFAULT_VERSION" + VN="$DEFAULT_VERSION" fi if test -r $LVF then - VC=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) + VC=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) else - VC=unset + VC=unset fi test "$VN" = "$VC" || { - echo "LUSTRE_VERSION = $VN" >$LVF + echo "LUSTRE_VERSION = $VN" >$LVF } echo $VN