diff --git a/wscript b/wscript index f1c9b6274c1..08b1cc69984 100644 --- a/wscript +++ b/wscript @@ -161,7 +161,7 @@ def svninfo(*args): def gitinfo(dir=None): if dir and not _isdir(dir): return '' - try: p = _Popen(['git','remote','show','-n','origin'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir) + try: p = _Popen(['git','rev-parse', '--short', 'HEAD'],stdin=PIPE,stdout=PIPE,stderr=PIPE,cwd=dir) except OSError,e: if e.errno == 2: return '' # svn command is not installed raise @@ -194,7 +194,7 @@ def allgitinfo(): return t + "\n\ncloustack-proprietary:\n" + u -def _getbuildnumber(): # FIXME implement for git +def _getbuildnumber(): n = Options.options.BUILDNUMBER if n: # luntbuild prepends "build-" to the build number. we work around this here: @@ -203,8 +203,8 @@ def _getbuildnumber(): # FIXME implement for git if n.startswith("$Revision:"): n = n[11:-2].strip() return n else: - # Try to guess the SVN revision number by calling SVN info. - stdout = svninfo() + # Try to guess the Git revision number + stdout = gitinfo() if not stdout: return '' # Filter lines. rev = [ x for x in stdout.splitlines() if x.startswith('SVN Revision') ]