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

Unified Diff: git_cache.py

Issue 1156743008: Add experimental support for python in 'git cl format' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gclient_utils.py ('k') | git_cl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cache.py
diff --git a/git_cache.py b/git_cache.py
index 8b2784248294fa7ec80746e497f6481731a08c2a..e80923cdbb074a0c27355bd51041341fd473ed27 100755
--- a/git_cache.py
+++ b/git_cache.py
@@ -185,24 +185,6 @@ class Mirror(object):
netpath = re.sub(r'\b-\b', '/', os.path.basename(path)).replace('--', '-')
return 'https://%s' % netpath
- @staticmethod
- def FindExecutable(executable):
- """This mimics the "which" utility."""
- path_folders = os.environ.get('PATH').split(os.pathsep)
-
- for path_folder in path_folders:
- target = os.path.join(path_folder, executable)
- # Just incase we have some ~/blah paths.
- target = os.path.abspath(os.path.expanduser(target))
- if os.path.isfile(target) and os.access(target, os.X_OK):
- return target
- if sys.platform.startswith('win'):
- for suffix in ('.bat', '.cmd', '.exe'):
- alt_target = target + suffix
- if os.path.isfile(alt_target) and os.access(alt_target, os.X_OK):
- return alt_target
- return None
-
@classmethod
def SetCachePath(cls, cachepath):
with cls.cachepath_lock:
@@ -273,12 +255,13 @@ class Mirror(object):
"""
python_fallback = False
- if sys.platform.startswith('win') and not self.FindExecutable('7z'):
+ if (sys.platform.startswith('win') and
+ not gclient_utils.FindExecutable('7z')):
python_fallback = True
elif sys.platform.startswith('darwin'):
# The OSX version of unzip doesn't support zip64.
python_fallback = True
- elif not self.FindExecutable('unzip'):
+ elif not gclient_utils.FindExecutable('unzip'):
python_fallback = True
gs_folder = 'gs://%s/%s' % (self.bootstrap_bucket, self.basedir)
« no previous file with comments | « gclient_utils.py ('k') | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698