[lttng-dev] [PATCH] Add bzr revno to the version if in a bzr repository

Raphaël Beamonte raphael.beamonte at gmail.com
Tue Jun 3 13:40:27 EDT 2014


Signed-off-by: Raphaël Beamonte <raphael.beamonte at gmail.com>
---
 include/Makefile.am | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 386c5ba..a677331 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -18,7 +18,13 @@ version.h:
 		##
 		git_branch="$$(git describe --all 2>/dev/null)"; \
 		if [ -z "$${git_branch}" ]; then \
-			git_version=""; \
+			## 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}" ] || \
-- 
2.0.0.rc2




More information about the lttng-dev mailing list