OLD | NEW |
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 Loading... |
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 Loading... |
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:])) |
OLD | NEW |