| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 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 custom_env = dict(os.environ) |
| 243 custom_env['LC_MESSAGES'] = 'en_GB' |
| 242 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, | 244 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE, |
| 243 stderr = subprocess.STDOUT, shell=IsWindows(), | 245 stderr = subprocess.STDOUT, shell=IsWindows(), |
| 244 env = {'LC_MESSAGES' : 'en_GB'}) | 246 env = custom_env) |
| 245 output, not_used = p.communicate() | 247 output, not_used = p.communicate() |
| 246 revision = ParseSvnInfoOutput(output) | 248 revision = ParseSvnInfoOutput(output) |
| 247 if revision: | 249 if revision: |
| 248 return revision | 250 return revision |
| 249 | 251 |
| 250 # maybe the builder is using git-svn, try that | 252 # maybe the builder is using git-svn, try that |
| 251 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, | 253 p = subprocess.Popen(['git', 'svn', 'info'], stdout = subprocess.PIPE, |
| 252 stderr = subprocess.STDOUT, shell=IsWindows()) | 254 stderr = subprocess.STDOUT, shell=IsWindows()) |
| 253 output, not_used = p.communicate() | 255 output, not_used = p.communicate() |
| 254 revision = ParseSvnInfoOutput(output) | 256 revision = ParseSvnInfoOutput(output) |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 | 403 |
| 402 def DartSdkBinary(): | 404 def DartSdkBinary(): |
| 403 tools_dir = os.path.dirname(os.path.realpath(__file__)) | 405 tools_dir = os.path.dirname(os.path.realpath(__file__)) |
| 404 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') | 406 dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin') |
| 405 return os.path.join(dart_binary_prefix, 'dart') | 407 return os.path.join(dart_binary_prefix, 'dart') |
| 406 | 408 |
| 407 | 409 |
| 408 if __name__ == "__main__": | 410 if __name__ == "__main__": |
| 409 import sys | 411 import sys |
| 410 Main(sys.argv) | 412 Main(sys.argv) |
| OLD | NEW |