From 92eccf89a188702b79d9f4ac59f2ff4c5c7aeaac Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 18 Sep 2010 18:45:41 +0200 Subject: waf: add a '+' to the git hash if the working tree isn't clean metze --- buildtools/wafsamba/samba_version.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'buildtools/wafsamba/samba_version.py') diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py index e5a8d6196c..0128670bab 100644 --- a/buildtools/wafsamba/samba_version.py +++ b/buildtools/wafsamba/samba_version.py @@ -78,6 +78,13 @@ also accepted as dictionary entries here SAMBA_VERSION_STRING += ("-GIT-" + self.GIT_COMMIT_ABBREV) + clean = Utils.cmd_output('git diff HEAD | wc -l', silent=True) + if clean == "0\n": + self.GIT_COMMIT_IS_CLEAN = True + else: + self.GIT_COMMIT_IS_CLEAN = False + SAMBA_VERSION_STRING += "+" + self.OFFICIAL_STRING=SAMBA_VERSION_STRING if self.VENDOR_SUFFIX is not None: @@ -121,6 +128,8 @@ also accepted as dictionary entries here string+="#define SAMBA_VERSION_GIT_COMMIT_FULLREV \"" + self.GIT_COMMIT_FULLREV + "\"\n" string+="#define SAMBA_VERSION_GIT_COMMIT_DATE \"" + self.GIT_COMMIT_DATE + "\"\n" string+="#define SAMBA_VERSION_GIT_COMMIT_TIME " + self.GIT_COMMIT_TIME + "\n" + if self.GIT_COMMIT_IS_CLEAN: + string+="#define SAMBA_VERSION_GIT_COMMIT_IS_CLEAN 1\n" except AttributeError: pass -- cgit