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

Side by Side Diff: git_cache.py

Issue 797663003: Use gsutil.py for download_from_google_storage instead of the builtin one (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Also modifies references in git_cache, upload_to_google_storage Created 6 years 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 | « download_from_google_storage.py ('k') | upload_to_google_storage.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """A git command for managing a local cache of git repositories.""" 6 """A git command for managing a local cache of git repositories."""
7 7
8 from __future__ import print_function 8 from __future__ import print_function
9 import errno 9 import errno
10 import logging 10 import logging
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 python_fallback = False 269 python_fallback = False
270 if sys.platform.startswith('win') and not self.FindExecutable('7z'): 270 if sys.platform.startswith('win') and not self.FindExecutable('7z'):
271 python_fallback = True 271 python_fallback = True
272 elif sys.platform.startswith('darwin'): 272 elif sys.platform.startswith('darwin'):
273 # The OSX version of unzip doesn't support zip64. 273 # The OSX version of unzip doesn't support zip64.
274 python_fallback = True 274 python_fallback = True
275 elif not self.FindExecutable('unzip'): 275 elif not self.FindExecutable('unzip'):
276 python_fallback = True 276 python_fallback = True
277 277
278 gs_folder = 'gs://%s/%s' % (self.bootstrap_bucket, self.basedir) 278 gs_folder = 'gs://%s/%s' % (self.bootstrap_bucket, self.basedir)
279 gsutil = Gsutil(self.gsutil_exe, boto_path=None, bypass_prodaccess=True) 279 gsutil = Gsutil(self.gsutil_exe, boto_path=None)
280 # Get the most recent version of the zipfile. 280 # Get the most recent version of the zipfile.
281 _, ls_out, _ = gsutil.check_call('ls', gs_folder) 281 _, ls_out, _ = gsutil.check_call('ls', gs_folder)
282 ls_out_sorted = sorted(ls_out.splitlines()) 282 ls_out_sorted = sorted(ls_out.splitlines())
283 if not ls_out_sorted: 283 if not ls_out_sorted:
284 # This repo is not on Google Storage. 284 # This repo is not on Google Storage.
285 return False 285 return False
286 latest_checkout = ls_out_sorted[-1] 286 latest_checkout = ls_out_sorted[-1]
287 287
288 # Download zip file to a temporary directory. 288 # Download zip file to a temporary directory.
289 try: 289 try:
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 return options, args 685 return options, args
686 686
687 687
688 def main(argv): 688 def main(argv):
689 dispatcher = subcommand.CommandDispatcher(__name__) 689 dispatcher = subcommand.CommandDispatcher(__name__)
690 return dispatcher.execute(OptionParser(), argv) 690 return dispatcher.execute(OptionParser(), argv)
691 691
692 692
693 if __name__ == '__main__': 693 if __name__ == '__main__':
694 sys.exit(main(sys.argv[1:])) 694 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « download_from_google_storage.py ('k') | upload_to_google_storage.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698