Chromium Code Reviews| Index: download_from_google_storage.py |
| diff --git a/download_from_google_storage.py b/download_from_google_storage.py |
| index 291643b1ee429099a1a27dd60731fb1f0c9a1914..fef29465385fe9d7b64cf9be49b7d6d7ba3f5d0f 100755 |
| --- a/download_from_google_storage.py |
| +++ b/download_from_google_storage.py |
| @@ -64,24 +64,19 @@ class Gsutil(object): |
| def get_sub_env(self): |
| env = os.environ.copy() |
| - if self.boto_path == os.devnull: |
| - env['AWS_CREDENTIAL_FILE'] = '' |
| - env['BOTO_CONFIG'] = '' |
| - elif self.boto_path: |
| + if self.boto_path: |
| env['AWS_CREDENTIAL_FILE'] = self.boto_path |
| env['BOTO_CONFIG'] = self.boto_path |
| - else: |
| - custompath = env.get('AWS_CREDENTIAL_FILE', '~/.boto') + '.depot_tools' |
| - custompath = os.path.expanduser(custompath) |
| - if os.path.exists(custompath): |
| - env['AWS_CREDENTIAL_FILE'] = custompath |
| return env |
| def call(self, *args): |
| cmd = [sys.executable, self.path, '--force-version', self.version] |
| cmd.extend(args) |
| - return subprocess2.call(cmd, env=self.get_sub_env(), timeout=self.timeout) |
| + if sys.platform.startswith('win'): |
| + return subprocess2.call(cmd, env=self.get_sub_env(), timeout=self.timeout) |
| + else: |
| + os.execv(sys.executable, cmd) |
|
Vadim Sh.
2015/06/17 19:24:04
why? Are you sure 'call' is not used multiple time
hinoka
2015/06/17 19:49:20
I thought it would've been cleaner, but on second
|
| def check_call(self, *args): |
| cmd = [sys.executable, self.path, '--force-version', self.version] |
| @@ -403,8 +398,11 @@ def main(args): |
| # Passing in -g/--config will run our copy of GSUtil, then quit. |
| if options.config: |
| - return gsutil.call('config', '-r', '-o', |
| - os.path.expanduser('~/.boto.depot_tools')) |
| + print '===Note from depot_tools===' |
| + print 'If you do not have a project ID, enter "0" when asked for one.' |
| + print '===End note from depot_tools===' |
| + return gsutil.call('config') |
| if not args: |
| parser.error('Missing target.') |