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

Unified Diff: win_toolchain/get_toolchain_if_necessary.py

Issue 144823003: Automatic toolchain: Use src-internal as signal for Pro (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: check svn access too 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win_toolchain/get_toolchain_if_necessary.py
diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py
index 654d5659c98fe9907ab65c542b8df6c2822bfba2..7aeb36fc040a3cb25421ac4cbfb2dfaef4ed9177 100755
--- a/win_toolchain/get_toolchain_if_necessary.py
+++ b/win_toolchain/get_toolchain_if_necessary.py
@@ -114,6 +114,20 @@ def SaveTimestampsAndHash(root, sha1):
json.dump(timestamps_data, f)
+def HaveSrcInternalAccess():
+ """Checks whether access to src-internal is available."""
+ with open(os.devnull, 'w') as nul:
+ git_rc = subprocess.call(
+ ['git', 'remote', 'show',
+ 'https://chrome-internal.googlesource.com/chrome/src-internal/'],
+ shell=True, stdout=nul, stderr=nul)
+ svn_rc = subprocess.call(
+ ['svn', 'ls',
+ 'svn://svn.chromium.org/chrome-internal/trunk/src-internal/'],
+ shell=True, stdout=nul, stderr=nul)
iannucci 2014/02/04 21:28:29 maybe stdin=nul as well? Why shell=True?
scottmg 2014/02/04 21:37:04 Done.
iannucci 2014/02/04 21:43:58 #!@*#!)$!@(
+ return git_rc == 0 or svn_rc == 0
iannucci 2014/02/04 21:28:29 Probably prefer svn for now, since we know it's fa
scottmg 2014/02/04 21:37:04 Done.
+
+
def main():
if not sys.platform.startswith(('cygwin', 'win32')):
return 0
@@ -125,9 +139,6 @@ def main():
# Move to depot_tools\win_toolchain where we'll store our files, and where
# the downloader script is.
os.chdir(os.path.normpath(os.path.join(BASEDIR)))
- # TODO(scottmg): http://crbug.com/323300 Attempt to locate a src-internal
- # pull and use that as a signal to install Pro also.
- should_get_pro = os.path.isfile(os.path.join(BASEDIR, '.vspro'))
toolchain_dir = '.'
target_dir = os.path.normpath(os.path.join(toolchain_dir, 'vs2013_files'))
@@ -143,6 +154,8 @@ def main():
# based on timestamps to make that case fast.
current_hash = CalculateHash(target_dir)
if current_hash not in desired_hashes:
+ should_get_pro = (os.path.isfile(os.path.join(BASEDIR, '.vspro')) or
+ HaveSrcInternalAccess())
print('Windows toolchain out of date or doesn\'t exist, updating (%s)...' %
('Pro' if should_get_pro else 'Express'))
# This stays resident and will make the rmdir below fail.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698