From 62fda5318f16c8e1c5514ddb7ae93238706fbf3c Mon Sep 17 00:00:00 2001 From: Marc Schink Date: Wed, 16 Nov 2016 15:03:07 +0100 Subject: [PATCH] Fix package version in out-of-tree builds Do not determine the Git revision hash from the repository in the current working directory because, in some circumstances, the revision hash of a commit from a different repository is used. For example, this happens when 'configure' is called from within an other Git repository. Signed-off-by: Marc Schink --- m4/jaylink.m4 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/m4/jaylink.m4 b/m4/jaylink.m4 index 7395421..749568d 100644 --- a/m4/jaylink.m4 +++ b/m4/jaylink.m4 @@ -25,11 +25,13 @@ m4_define([_JAYLINK_SET_PACKAGE_VERSION], [ m4_assert([$# == 5]) # Get the short Git revision hash of the current commit. - git_version=`git rev-parse --short HEAD 2> /dev/null` + git_version=`git --git-dir="$srcdir/.git" rev-parse \ + --short HEAD 2> /dev/null` # Try to get the release tag for the package version from the current # commit. - tag=`git describe --match "$2" --exact-match 2> /dev/null` + tag=`git --git-dir="$srcdir/.git" describe --match "$2" \ + --exact-match 2> /dev/null` version=$2 -- 2.11.4.GIT