largely complete automated generation of cheat sheets & bindings from templates,...
[ardour.git] / wscript
diff --git a/wscript b/wscript
index f9ab47a525f245d8656c9ae56ba82cb1ee8d2e66..ffe7aa89ec3012eb3a240ef6adba97d90918ac9c 100644 (file)
--- a/wscript
+++ b/wscript
@@ -5,6 +5,7 @@ import os
 import commands
 import re
 import string
+import subprocess
 
 # Variables for 'waf dist'
 VERSION = '3.0pre0'
@@ -53,12 +54,23 @@ def fetch_git_revision (path):
                        pass
        return rev
 
+def fetch_bzr_revision (path):
+       cmd = subprocess.Popen("LANG= bzr log -l 1 " + path, stdout=subprocess.PIPE, shell=True)
+       out = cmd.communicate()[0]
+       svn = re.search('^svn revno: [0-9]*', out, re.MULTILINE)
+       str = svn.group(0)
+       chars = 'svnreio: '
+       return string.lstrip(str, chars)
+
 def create_stored_revision():
        rev = ""
        if os.path.exists('.svn'):
                rev = fetch_svn_revision('.');
        elif os.path.exists('.git'):
                rev = fetch_git_revision('.');
+       elif os.path.exists('.bzr'):
+               rev = fetch_bzr_revision('.');
+               print "Revision: " + rev;
        elif os.path.exists('libs/ardour/svn_revision.cc'):
                print "Using packaged svn revision"
                return