bot_update: Use 'gclient' from same repository.

Currently, 'bot_update' uses the 'gclient' that is on the system path.
Now, it will use the 'gclient.py' that is in the same 'depot_tools'
checkout as the 'bot_update' recipe module.

Also don't ignore "git_cache" move errors.

BUG=664254,663990,663440
TEST=None

Review-Url: https://codereview.chromium.org/2492963002
This commit is contained in:
dnj
2016-11-10 15:51:39 -08:00
committed by Commit bot
parent b84b5e3a13
commit b445ef568c
3 changed files with 30 additions and 21 deletions

View File

@@ -439,16 +439,9 @@ class Mirror(object):
self._fetch(tempdir or self.mirror_path, verbose, depth)
finally:
if tempdir:
try:
if os.path.exists(self.mirror_path):
gclient_utils.rmtree(self.mirror_path)
os.rename(tempdir, self.mirror_path)
except OSError as e:
# This is somehow racy on Windows.
# Catching OSError because WindowsError isn't portable and
# pylint complains.
self.print('Error moving %s to %s: %s' % (tempdir, self.mirror_path,
str(e)))
if os.path.exists(self.mirror_path):
gclient_utils.rmtree(self.mirror_path)
os.rename(tempdir, self.mirror_path)
if not ignore_lock:
lockfile.unlock()