Skip to content

Commit

Permalink
build: persuade git-version-gen vMAJOR.MINOR tags just miss .0
Browse files Browse the repository at this point in the history
Recent "v1.0" discovered this discrepancy propagated all around
and also this is not very compatible with the logic of commit 26d3911.

Treat missing "patch" component of the version as an implicit zero
to make such oddity go away.

Adjust spec file generation accordingly.
  • Loading branch information
jnpkrn committed Apr 4, 2016
1 parent 137b3de commit bd31052
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ $(SPEC): $(SPEC).in
@rm -f $@-t $@
@date="$(shell LC_ALL=C date "+%a %b %d %Y")" && \
if [ -f .tarball-version ]; then \
gitver="$(shell cat .tarball-version)" && \
ver="$(shell cat .tarball-version)" && \
gitver=`echo $$ver | sed \
-e 's|^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$$|\1.0\2|'` && \
rpmver=$$gitver && \
alphatag="" && \
dirty="" && \
numcomm="0"; \
else \
gitver="$(shell git describe --abbrev=4 --match='v*' --tags HEAD 2>/dev/null)" && \
ver="$(shell git describe --abbrev=4 --match='v*' --tags HEAD 2>/dev/null)" && \
gitver=`echo $$ver | sed \
-e 's|^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$$|\1.0\2|'` && \
rpmver=`echo $$gitver | sed -e "s/^v//" -e "s/-.*//g"` && \
alphatag=`echo $$gitver | sed -e "s/.*-//" -e "s/^g//"` && \
vtag=`echo $$gitver | sed -e "s/-.*//g"` && \
vtag=`echo $$ver | sed -e "s/-.*//g"` && \
numcomm=`git rev-list $$vtag..HEAD | wc -l` && \
git update-index --refresh > /dev/null 2>&1 || true && \
dirty=`git diff-index --name-only HEAD 2>/dev/null`; \
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

AC_PREREQ([2.61])

dnl inject zero as a "patch" component of the version if missing in tag
AC_INIT([libqb],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
m4_esyscmd([build-aux/git-version-gen .tarball-version \
's|^\(v[0-9][0-9]*\.[0-9][0-9]*\)\([^.].*\)\?$|\1.0\2|']),
[developers@clusterlabs.org])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([lib/ringbuffer.c])
Expand Down

0 comments on commit bd31052

Please sign in to comment.