| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import stat | 6 import stat |
| 7 | 7 |
| 8 from catapult_base import cloud_storage | 8 from catapult_base import cloud_storage |
| 9 from telemetry import decorators | 9 from telemetry import decorators |
| 10 from telemetry.internal.util import path | 10 from telemetry.internal.util import path |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 if not command and _IsInCloudStorage(binary_name, arch_name, platform_name): | 49 if not command and _IsInCloudStorage(binary_name, arch_name, platform_name): |
| 50 cloud_storage.GetIfChanged( | 50 cloud_storage.GetIfChanged( |
| 51 _GetBinPath(binary_name, arch_name, platform_name), | 51 _GetBinPath(binary_name, arch_name, platform_name), |
| 52 cloud_storage.PUBLIC_BUCKET) | 52 cloud_storage.PUBLIC_BUCKET) |
| 53 command = _GetBinPath(binary_name, arch_name, platform_name) | 53 command = _GetBinPath(binary_name, arch_name, platform_name) |
| 54 | 54 |
| 55 # Ensure the downloaded file is actually executable. | 55 # Ensure the downloaded file is actually executable. |
| 56 if command and os.path.exists(command): | 56 if command and os.path.exists(command): |
| 57 os.chmod(command, | 57 os.chmod(command, |
| 58 stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP) | 58 stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | stat.S_IRGRP) |
| 59 if not command and platform_name == 'win' and arch_name != 'AMD64': |
| 60 # This is an awful, awful hack to temporarily fix cloud_storage downloads |
| 61 # on XP until the binary_manager is finished and migrated to. |
| 62 # Please don't try this at home. |
| 63 return FindPath(binary_name, 'AMD64', platform_name) |
| 59 | 64 |
| 60 # Return an absolute path consistently. | 65 # Return an absolute path consistently. |
| 61 if command: | 66 if command: |
| 62 command = os.path.abspath(command) | 67 command = os.path.abspath(command) |
| 63 return command | 68 return command |
| OLD | NEW |