Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: tools/utils.py

Issue 10117031: Move 'revision' file creation from upload_sdk into create_sdk (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/upload_sdk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 def GetBuildRoot(target_os, mode=None, arch=None): 154 def GetBuildRoot(target_os, mode=None, arch=None):
155 global BUILD_ROOT 155 global BUILD_ROOT
156 if mode: 156 if mode:
157 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch)) 157 return os.path.join(BUILD_ROOT[target_os], GetBuildConf(mode, arch))
158 else: 158 else:
159 return BUILD_ROOT[target_os] 159 return BUILD_ROOT[target_os]
160 160
161 def GetBaseDir(): 161 def GetBaseDir():
162 return BASE_DIR 162 return BASE_DIR
163 163
164 def GetSVNRevision():
165 p = subprocess.Popen(['svn', 'info'], stdout = subprocess.PIPE,
166 stderr = subprocess.STDOUT, shell=IsWindows())
167 output, not_used = p.communicate()
168 for line in output.split('\n'):
169 if 'Revision' in line:
170 return (line.strip().split())[1]
171 return None
172
164 def RewritePathSeparator(path, workspace): 173 def RewritePathSeparator(path, workspace):
165 # Paths in test files are always specified using '/' 174 # Paths in test files are always specified using '/'
166 # as the path separator. Replace with the actual 175 # as the path separator. Replace with the actual
167 # path separator before use. 176 # path separator before use.
168 if ('/' in path): 177 if ('/' in path):
169 split_path = path.split('/') 178 split_path = path.split('/')
170 path = os.sep.join(split_path) 179 path = os.sep.join(split_path)
171 path = os.path.join(workspace, path) 180 path = os.path.join(workspace, path)
172 if not os.path.exists(path): 181 if not os.path.exists(path):
173 raise Exception(path) 182 raise Exception(path)
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 282
274 def DiagnoseExitCode(exit_code, command): 283 def DiagnoseExitCode(exit_code, command):
275 if IsCrashExitCode(exit_code): 284 if IsCrashExitCode(exit_code):
276 sys.stderr.write('Command: %s\nCRASHED with exit code %d (0x%x)\n' % ( 285 sys.stderr.write('Command: %s\nCRASHED with exit code %d (0x%x)\n' % (
277 ' '.join(command), exit_code, exit_code & 0xffffffff)) 286 ' '.join(command), exit_code, exit_code & 0xffffffff))
278 287
279 288
280 if __name__ == "__main__": 289 if __name__ == "__main__":
281 import sys 290 import sys
282 Main(sys.argv) 291 Main(sys.argv)
OLDNEW
« no previous file with comments | « tools/upload_sdk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698