diff options
author | Marc Schink <dev@zapb.de> | 2020-12-12 12:05:59 +0100 |
---|---|---|
committer | Marc Schink <dev@zapb.de> | 2020-12-13 11:29:12 +0100 |
commit | 11fb2f4bca89c05d0b9c9525c0d82847a6dcf4af (patch) | |
tree | 77c9cbad8bf28058d94d34ee4ba105b733f1f4ad /m4 | |
parent | 7233b17aa010af9a4d02d9ba97f26cae084402cf (diff) | |
download | libjaylink-11fb2f4bca89c05d0b9c9525c0d82847a6dcf4af.zip libjaylink-11fb2f4bca89c05d0b9c9525c0d82847a6dcf4af.tar.gz libjaylink-11fb2f4bca89c05d0b9c9525c0d82847a6dcf4af.tar.bz2 |
Use a new package version scheme
If available, the Git repository description is used as package
version. Otherwise, the version provided by Autoconf is used. The scheme
for release versions remains the same.
Signed-off-by: Marc Schink <dev@zapb.de>
Diffstat (limited to 'm4')
-rw-r--r-- | m4/jaylink.m4 | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/m4/jaylink.m4 b/m4/jaylink.m4 index 749568d..e6346a8 100644 --- a/m4/jaylink.m4 +++ b/m4/jaylink.m4 @@ -24,22 +24,14 @@ m4_define([_JAYLINK_SET_PACKAGE_VERSION], [ m4_assert([$# == 5]) - # Get the short Git revision hash of the current commit. - git_version=`git --git-dir="$srcdir/.git" rev-parse \ - --short HEAD 2> /dev/null` + # Get the Git repository description. Ensure that we use our Git + # repository even when there is a parent Git repository. + git_version=`git -C "$srcdir" --git-dir=.git describe --dirty 2> /dev/null` - # Try to get the release tag for the package version from the current - # commit. - tag=`git --git-dir="$srcdir/.git" describe --match "$2" \ - --exact-match 2> /dev/null` - - version=$2 - - # If Git is available, append the short Git revision hash of the - # current commit to the version string if there is no release tag for - # the package version on it. - AS_IF([test -n "$git_version" && test -z "$tag"], - [version="$version-git-$git_version"]) + # If available, use the Git description as package version. Otherwise, + # use the version provided by Autoconf. + AS_IF([test -n "$git_version"], [version="$git_version"], + [version="$2"]) AC_SUBST([$1_MAJOR], [$3]) AC_SUBST([$1_MINOR], [$4]) |