| OLD | NEW |
| 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 Loading... |
| 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: bot_update has run and checkout is already ' |
| 412 print 'in a consistent state. No actions will be performed in this step.' |
| 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 Loading... |
| 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 |
| OLD | NEW |