summaryrefslogtreecommitdiffstats
path: root/WebKitTools/wx/build/build_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/wx/build/build_utils.py')
-rw-r--r--WebKitTools/wx/build/build_utils.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/WebKitTools/wx/build/build_utils.py b/WebKitTools/wx/build/build_utils.py
index 0a795a8..b767d9f 100644
--- a/WebKitTools/wx/build/build_utils.py
+++ b/WebKitTools/wx/build/build_utils.py
@@ -27,13 +27,12 @@ import commands
import glob
import os
import platform
+import re
import shutil
import sys
import urllib
import urlparse
-import Logs
-
def get_output(command):
"""
Windows-compatible function for getting output from a command.
@@ -110,6 +109,7 @@ def update_wx_deps(conf, wk_root, msvc_version='msvc2008'):
"""
Download and update tools needed to build the wx port.
"""
+ import Logs
Logs.info('Ensuring wxWebKit dependencies are up-to-date.')
wklibs_dir = os.path.join(wk_root, 'WebKitLibraries')
@@ -154,3 +154,35 @@ def flattenSources(sources):
flat_sources.extend(group)
return flat_sources
+
+def git_branch_name():
+ try:
+ branches = commands.getoutput("git branch --no-color")
+ match = re.search('^\* (.*)', branches, re.MULTILINE)
+ if match:
+ return ".%s" % match.group(1)
+ except:
+ pass
+
+ return ""
+
+def get_config(wk_root):
+ config_file = os.path.join(wk_root, 'WebKitBuild', 'Configuration')
+ config = 'Debug'
+
+ if os.path.exists(config_file):
+ config = open(config_file).read()
+
+ return config
+
+def svn_revision():
+ if os.system("git info") == 0:
+ info = commands.getoutput("git-svn info ../..")
+ else:
+ info = commands.getoutput("svn info")
+
+ for line in info.split("\n"):
+ if line.startswith("Revision: "):
+ return line.replace("Revision: ", "").strip()
+
+ return ""