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

Side by Side Diff: scripts/common/chromium_utils.py

Issue 157073002: Bot update! (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: We dont' actually want to run on chromium.linux yet Created 6 years, 10 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
« no previous file with comments | « no previous file | scripts/slave/bot_update.py » ('j') | scripts/slave/bot_update.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 """ Set of basic operations/utilities that are used by the build. """ 5 """ Set of basic operations/utilities that are used by the build. """
6 6
7 import copy 7 import copy
8 import cStringIO 8 import cStringIO
9 import errno 9 import errno
10 import fnmatch 10 import fnmatch
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 Even with all this, Windows still sometimes fails to delete a file, citing 400 Even with all this, Windows still sometimes fails to delete a file, citing
401 a permission error (maybe something to do with antivirus scans or disk 401 a permission error (maybe something to do with antivirus scans or disk
402 indexing). The best suggestion any of the user forums had was to wait a 402 indexing). The best suggestion any of the user forums had was to wait a
403 bit and try again, so we do that too. It's hand-waving, but sometimes it 403 bit and try again, so we do that too. It's hand-waving, but sometimes it
404 works. :/ 404 works. :/
405 """ 405 """
406 file_path = os.path.join(*path) 406 file_path = os.path.join(*path)
407 if not os.path.exists(file_path): 407 if not os.path.exists(file_path):
408 return 408 return
409 409
410 if os.path.isfile(os.path.join(file_path, 'update.flag')):
411 print 'update.flag file found. This means "bot update" ran and acquired'
412 print 'a git checkout already. Skipping this step.'
agable 2014/02/07 04:47:40 Not sure I like this phrasing. Maybe "update.flag
Ryan Tseng 2014/02/07 21:23:07 Done.
413 return
414
410 if sys.platform == 'win32': 415 if sys.platform == 'win32':
411 # Give up and use cmd.exe's rd command. 416 # Give up and use cmd.exe's rd command.
412 file_path = os.path.normcase(file_path) 417 file_path = os.path.normcase(file_path)
413 for _ in xrange(3): 418 for _ in xrange(3):
414 if not subprocess.call(['cmd.exe', '/c', 'rd', '/q', '/s', file_path]): 419 if not subprocess.call(['cmd.exe', '/c', 'rd', '/q', '/s', file_path]):
415 break 420 break
416 time.sleep(3) 421 time.sleep(3)
417 return 422 return
418 423
419 def RemoveWithRetry_non_win(rmfunc, path): 424 def RemoveWithRetry_non_win(rmfunc, path):
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 module_file = os.path.splitext(module_file)[0] 1341 module_file = os.path.splitext(module_file)[0]
1337 1342
1338 saved = sys.path 1343 saved = sys.path
1339 sys.path = [dir_path] + (extra_paths or []) 1344 sys.path = [dir_path] + (extra_paths or [])
1340 try: 1345 try:
1341 return __import__(module_file) 1346 return __import__(module_file)
1342 except ImportError: 1347 except ImportError:
1343 pass 1348 pass
1344 finally: 1349 finally:
1345 sys.path = saved 1350 sys.path = saved
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/bot_update.py » ('j') | scripts/slave/bot_update.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698