From: Brian J. Murrell Date: Mon, 9 May 2011 19:11:12 +0000 (-0400) Subject: LU-278 only use the v* tag and limit the match X-Git-Tag: 2.0.61.0~11 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3bf2ba3f3aa847e6d5ea9e0653e853aad0f4b95b;hp=53def88477b3f50e129e0cdad7036059414919eb LU-278 only use the v* tag and limit the match In order to allow people to create tags such as 2.0.59-1foobar, only try to match on the v* type tags, and even then, tighten up the match pattern (as best we can using globs) to try to limit the number of false positives. Signed-off-by: Brian J. Murrell Change-Id: I2d6e422fc0c17df7eb4169efea8e3557e80b941d Reviewed-on: http://review.whamcloud.com/517 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Michael MacDonald Reviewed-by: Oleg Drokin --- diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4 index 1dd260a..800925d 100644 --- a/build/autoconf/lustre-build.m4 +++ b/build/autoconf/lustre-build.m4 @@ -61,7 +61,7 @@ BUILDID="" if git branch >/dev/null 2>&1; then ffw=0 hash="" - ver=$(git describe --match [[0-9v]]\* --tags) + ver=$(git describe --match v[[0-9]]_*_[[0-9]] --tags) if [[[ $ver = *-*-* ]]]; then hash=${ver##*-} ffw=${ver#*-} @@ -84,7 +84,10 @@ if git branch >/dev/null 2>&1; then if [[[ $ver = v*_*_*_0 ]]]; then ver=${ver%_0} fi - + if [[[ $ver = v*_*_* ]]]; then + ver=${ver#v} + ver=${ver//_/.} + fi # only do this test for lustre (not ldiskfs) if test "$PACKAGE" = "lustre" -a "$ver" != "$VERSION"; then