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

Side by Side Diff: gsutil.py

Issue 1587793002: Add in option to always disable gsutil version check (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 """Run a pinned gsutil.""" 6 """Run a pinned gsutil."""
7 7
8 8
9 import argparse 9 import argparse
10 import base64 10 import base64
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if not check_gsutil(gsutil_bin): 118 if not check_gsutil(gsutil_bin):
119 raise InvalidGsutilError() 119 raise InvalidGsutilError()
120 return gsutil_bin 120 return gsutil_bin
121 121
122 122
123 def run_gsutil(force_version, fallback, target, args, clean=False): 123 def run_gsutil(force_version, fallback, target, args, clean=False):
124 if force_version: 124 if force_version:
125 gsutil_bin = ensure_gsutil(force_version, target, clean) 125 gsutil_bin = ensure_gsutil(force_version, target, clean)
126 else: 126 else:
127 gsutil_bin = fallback 127 gsutil_bin = fallback
128 cmd = [sys.executable, gsutil_bin] + args 128 disable_update = ['-o', 'GSUtil:software_update_check_period=0']
129 cmd = [sys.executable, gsutil_bin] + disable_update + args
129 return subprocess.call(cmd) 130 return subprocess.call(cmd)
130 131
131 132
132 def parse_args(): 133 def parse_args():
133 bin_dir = os.environ.get('DEPOT_TOOLS_GSUTIL_BIN_DIR', DEFAULT_BIN_DIR) 134 bin_dir = os.environ.get('DEPOT_TOOLS_GSUTIL_BIN_DIR', DEFAULT_BIN_DIR)
134 135
135 parser = argparse.ArgumentParser() 136 parser = argparse.ArgumentParser()
136 parser.add_argument('--force-version', default='4.13') 137 parser.add_argument('--force-version', default='4.13')
137 parser.add_argument('--clean', action='store_true', 138 parser.add_argument('--clean', action='store_true',
138 help='Clear any existing gsutil package, forcing a new download.') 139 help='Clear any existing gsutil package, forcing a new download.')
(...skipping 11 matching lines...) Expand all
150 return args 151 return args
151 152
152 153
153 def main(): 154 def main():
154 args = parse_args() 155 args = parse_args()
155 return run_gsutil(args.force_version, args.fallback, args.target, args.args, 156 return run_gsutil(args.force_version, args.fallback, args.target, args.args,
156 clean=args.clean) 157 clean=args.clean)
157 158
158 if __name__ == '__main__': 159 if __name__ == '__main__':
159 sys.exit(main()) 160 sys.exit(main())
OLDNEW
« 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