Add bzr revno to the version if in a bzr repository
A message that is not in the archive (sent off-list or not yet received): edd264d153b5ab8dbb2cad9bbc63d05d1ae0cc09.1401817136.git.raphael.beamonte@gmail.com
PATCH 1/1 Add bzr revno to the version if in a bzr repository
Sorry, forgot the "lttng-tools" tag.
Just to give some context, we had a problem with the Ubuntu PPA packages, where the version in version.h would not get set to anything, and the resulting binary wouldn't report a version number when doing lttng --version.
Turned out it's because Launchpad imports everything to bzr branches, which scrubs the .git directory, and builds the package from that. So the .git directory was not available when building. Which caused the empty version.h (it's easy to reproduce locally, just delete the .git directory then build).
I tested this patch, and it works well when building from the bzr branch. Nice work!
However, should we also handle the case where there is neither a .git or .bzr directory, and only use the version from configure.ac?
Cheers,
Alexandre
Quoted 14 lines · Raphaël Beamonte
Signed-off-by Raphaël Beamonte <[email protected]>--- include/Makefile.am | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)include/Makefile.am +0
-1@@ -18,7 +18,13 @@ version.h: ## git_branch="$$(git describe --all 2>/dev/null)"; \ if [ -z "$${git_branch}" ]; then \ - git_version=""; \
include/Makefile.am version.h: · line 30
Quoted 10 lines
include/Makefile.am +7
-0+ ## If we are not in a git repository, we can try bzr + bzr_version="$$(bzr log -S -l1 2>/dev/null | head -n1 | cut -d' ' -f2)"; \ + if [ -n "$${bzr_version}" ]; then \ + git_version="\" VERSION \"-bzr$${bzr_version}"; \ + else \ + git_version=""; \ + fi; \ else \ git_describe="$$(git describe)"; \ if [ "$${git_branch}" == "$${git_describe}" ] || \
_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev