diff options
author | Marc Schink <jaylink-dev@marcschink.de> | 2016-11-16 15:03:07 +0100 |
---|---|---|
committer | Marc Schink <jaylink-dev@marcschink.de> | 2016-11-17 22:15:25 +0100 |
commit | 62fda5318f16c8e1c5514ddb7ae93238706fbf3c (patch) | |
tree | e513cae1495cbf053f8db72e89995023315c2783 | |
parent | c2ad600925292806c1bb3f4469d157ab5e6ccaee (diff) | |
download | libjaylink-62fda5318f16c8e1c5514ddb7ae93238706fbf3c.zip libjaylink-62fda5318f16c8e1c5514ddb7ae93238706fbf3c.tar.gz libjaylink-62fda5318f16c8e1c5514ddb7ae93238706fbf3c.tar.bz2 |
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 <jaylink-dev@marcschink.de>
-rw-r--r-- | m4/jaylink.m4 | 6 |
1 files 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 |