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

Side by Side Diff: native_client_sdk/src/build_tools/build_utils.py

Issue 10868089: add PRESUBMIT for native_client_sdk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Small utility library of python functions used by the various package 5 """Small utility library of python functions used by the various package
6 installers. 6 installers.
7 """ 7 """
8 8
9 import datetime 9 import datetime
10 import errno 10 import errno
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 This file either needs to be in either a subversion repository or 180 This file either needs to be in either a subversion repository or
181 a git repository that is sync'd to a subversion repository using git-svn.''' 181 a git repository that is sync'd to a subversion repository using git-svn.'''
182 run_path = os.path.dirname(os.path.abspath(__file__)) 182 run_path = os.path.dirname(os.path.abspath(__file__))
183 p = subprocess.Popen('svn info', shell=True, stdout=subprocess.PIPE, 183 p = subprocess.Popen('svn info', shell=True, stdout=subprocess.PIPE,
184 cwd=run_path) 184 cwd=run_path)
185 if p.wait() != 0: 185 if p.wait() != 0:
186 p = subprocess.Popen('git svn info', shell=True, stdout=subprocess.PIPE, 186 p = subprocess.Popen('git svn info', shell=True, stdout=subprocess.PIPE,
187 cwd=run_path) 187 cwd=run_path)
188 if p.wait() != 0: 188 if p.wait() != 0:
189 raise AssertionError('Cannot determine SVN revision of this repository'); 189 raise AssertionError('Cannot determine SVN revision of this repository')
190 190
191 svn_info = p.communicate()[0] 191 svn_info = p.communicate()[0]
192 m = re.search('Revision: ([0-9]+)', svn_info) 192 m = re.search('Revision: ([0-9]+)', svn_info)
193 if m: 193 if m:
194 return int(m.group(1)) 194 return int(m.group(1))
195 else: 195 else:
196 raise AssertionError('Cannot extract revision number from svn info') 196 raise AssertionError('Cannot extract revision number from svn info')
197 197
198 198
199 def VersionString(): 199 def VersionString():
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 Args: 296 Args:
297 dir: The directory to clean 297 dir: The directory to clean
298 ''' 298 '''
299 if sys.platform != 'win32': 299 if sys.platform != 'win32':
300 shutil.rmtree(dir, ignore_errors=True) 300 shutil.rmtree(dir, ignore_errors=True)
301 else: 301 else:
302 # Intentionally ignore return value since a directory might be in use. 302 # Intentionally ignore return value since a directory might be in use.
303 subprocess.call(['rmdir', '/Q', '/S', dir], 303 subprocess.call(['rmdir', '/Q', '/S', dir],
304 env=os.environ.copy(), 304 env=os.environ.copy(),
305 shell=True) 305 shell=True)
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/build_sdk.py ('k') | native_client_sdk/src/build_tools/make_rules.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698