summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba/samba_version.py
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-09-18 18:45:41 +0200
committerStefan Metzmacher <metze@samba.org>2010-09-19 07:40:39 +0200
commit92eccf89a188702b79d9f4ac59f2ff4c5c7aeaac (patch)
tree4b9a965b7a65a8b615dbb3d6eaf50ba7a74524ea /buildtools/wafsamba/samba_version.py
parenta66db2cb7897fe0e40e9e520f75cccb14d3a1721 (diff)
downloadsamba-92eccf89a188702b79d9f4ac59f2ff4c5c7aeaac.tar.gz
samba-92eccf89a188702b79d9f4ac59f2ff4c5c7aeaac.tar.bz2
samba-92eccf89a188702b79d9f4ac59f2ff4c5c7aeaac.zip
waf: add a '+' to the git hash if the working tree isn't clean
metze
Diffstat (limited to 'buildtools/wafsamba/samba_version.py')
-rw-r--r--buildtools/wafsamba/samba_version.py9
1 files changed, 9 insertions, 0 deletions
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