configure: Fix BUILDID (again)

The previous commit made BUILDID use git for submodule, but for complex
git setup (e.g. worktree) and older git version or dead .git 'link' it
would blindly rely on the existence of the .git file even if git does not
actually find anything.
This would lead to possibly empty BUILDID which would fail building.

Just always run the git command, and echo the version string if it failed

Change-Id: Ied268d2150a30dc1146498e15fa8394afc8a8d0d
This commit is contained in:
Dominique Martinet
2018-11-21 22:46:36 +09:00
parent b2a58ce3e3
commit 6ca5aaa1fc
3 changed files with 3 additions and 3 deletions

2
configure vendored
View File

@ -4886,7 +4886,7 @@ _ACEOF
ABS_SRCDIR=$( cd $( dirname $0 ); pwd )
IHK_ABS_SRCDIR=${ABS_SRCDIR}/../ihk
BUILDID=$( cd $IHK_ABS_SRCDIR; if [ ! -e .git ]; then echo $IHK_VERSION; else bash -c 'git rev-list -1 HEAD | cut -c1-8'; fi )
BUILDID=$( git --git-dir=$IHK_ABS_SRCDIR/.git rev-parse --short HEAD 2>/dev/null || echo $IHK_VERSION )
{ $as_echo "$as_me:${as_lineno-$LINENO}: BUILDID=$BUILDID" >&5
$as_echo "$as_me: BUILDID=$BUILDID" >&6;}
if test "x$BUILDID" != "x" ; then

View File

@ -544,7 +544,7 @@ AC_DEFINE_UNQUOTED(MCKERNEL_VERSION,"$MCKERNEL_VERSION",[McKernel version string
ABS_SRCDIR=$( cd $( dirname $0 ); pwd )
IHK_ABS_SRCDIR=${ABS_SRCDIR}/../ihk
BUILDID=$( cd $IHK_ABS_SRCDIR; if @<:@ ! -e .git @:>@; then echo $IHK_VERSION; else bash -c 'git rev-list -1 HEAD | cut -c1-8'; fi )
BUILDID=$( git --git-dir=$IHK_ABS_SRCDIR/.git rev-parse --short HEAD 2>/dev/null || echo $IHK_VERSION )
AC_MSG_NOTICE([BUILDID=$BUILDID])
if test "x$BUILDID" != "x" ; then
AC_DEFINE_UNQUOTED(BUILDID,"$BUILDID",[IHK build-id to confirm IHK and McKernel built at the same time are used])

2
ihk

Submodule ihk updated: a7a200fd3e...4a8e719fa0