| OLD | NEW |
| 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
| 3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 # This file contains a set of utilities functions used by other Python-based | 5 # This file contains a set of utilities functions used by other Python-based |
| 6 # scripts. | 6 # scripts. |
| 7 | 7 |
| 8 import commands | 8 import commands |
| 9 import os | 9 import os |
| 10 import platform | 10 import platform |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 def GetVersion(): | 233 def GetVersion(): |
| 234 dartbin = DartBinary() | 234 dartbin = DartBinary() |
| 235 version_script = VersionScript() | 235 version_script = VersionScript() |
| 236 p = subprocess.Popen([dartbin, version_script], stdout = subprocess.PIPE, | 236 p = subprocess.Popen([dartbin, version_script], stdout = subprocess.PIPE, |
| 237 stderr = subprocess.STDOUT, shell=IsWindows()) | 237 stderr = subprocess.STDOUT, shell=IsWindows()) |
| 238 output, not_used = p.communicate() | 238 output, not_used = p.communicate() |
| 239 return output.strip() | 239 return output.strip() |
| 240 | 240 |
| 241 def GetSVNRevision(): | 241 def GetSVNRevision(): |
| 242 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, | 242 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, |
| 243 stderr = subprocess.STDOUT, shell=IsWindows()) | 243 stderr = subprocess.STDOUT, shell=IsWindows(), |
| 244 env = {'LC_MESSAGES' : 'en_GB'}) |
| 244 output, not_used = p.communicate() | 245 output, not_used = p.communicate() |
| 245 revision = ParseSvnInfoOutput(output) | 246 revision = ParseSvnInfoOutput(output) |
| 246 if revision: | 247 if revision: |
| 247 return revision | 248 return revision |
| 248 | 249 |
| 249 # maybe the builder is using git-svn, try that | 250 # maybe the builder is using git-svn, try that |
| 250 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, | 251 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, |
| 251 stderr = subprocess.STDOUT, shell=IsWindows()) | 252 stderr = subprocess.STDOUT, shell=IsWindows()) |
| 252 output, not_used = p.communicate() | 253 output, not_used = p.communicate() |
| 253 revision = ParseSvnInfoOutput(output) | 254 revision = ParseSvnInfoOutput(output) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 401 |
| 401 def DartSdkBinary(): | 402 def DartSdkBinary(): |
| 402 tools_dir = os.path.dirname(os.path.realpath(__file__)) | 403 tools_dir = os.path.dirname(os.path.realpath(__file__)) |
| 403 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') | 404 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') |
| 404 return os.path.join(dart_binary_prefix, 'dart') | 405 return os.path.join(dart_binary_prefix, 'dart') |
| 405 | 406 |
| 406 | 407 |
| 407 if __name__ == "__main__": | 408 if __name__ == "__main__": |
| 408 import sys | 409 import sys |
| 409 Main(sys.argv) | 410 Main(sys.argv) |
| OLD | NEW |