OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 import os | |
7 import re | |
8 import subprocess | |
9 from sdk_update_common import * | |
10 import sys | |
11 import tempfile | |
12 | |
13 """Shim script for the SDK updater, to allow automatic updating. | 6 """Shim script for the SDK updater, to allow automatic updating. |
14 | 7 |
15 The purpose of this script is to be a shim which automatically updates | 8 The purpose of this script is to be a shim which automatically updates |
16 sdk_tools (the bundle containing the updater scripts) whenever this script is | 9 sdk_tools (the bundle containing the updater scripts) whenever this script is |
17 run. | 10 run. |
18 | 11 |
19 When the sdk_tools bundle has been updated to the most recent version, this | 12 When the sdk_tools bundle has been updated to the most recent version, this |
20 script forwards its arguments to sdk_updater_main.py. | 13 script forwards its arguments to sdk_updater_main.py. |
21 """ | 14 """ |
22 | 15 |
| 16 import os |
| 17 import subprocess |
| 18 from sdk_update_common import * |
| 19 import sys |
| 20 import tempfile |
| 21 |
23 | 22 |
24 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
25 SDK_UPDATE_MAIN = os.path.join(SCRIPT_DIR, 'sdk_update_main.py') | 24 SDK_UPDATE_MAIN = os.path.join(SCRIPT_DIR, 'sdk_update_main.py') |
26 SDK_ROOT_DIR = os.path.dirname(SCRIPT_DIR) | 25 SDK_ROOT_DIR = os.path.dirname(SCRIPT_DIR) |
27 NACLSDK_SHELL_SCRIPT = os.path.join(SDK_ROOT_DIR, 'naclsdk') | 26 NACLSDK_SHELL_SCRIPT = os.path.join(SDK_ROOT_DIR, 'naclsdk') |
28 if sys.platform.startswith('win'): | 27 if sys.platform.startswith('win'): |
29 NACLSDK_SHELL_SCRIPT += '.bat' | 28 NACLSDK_SHELL_SCRIPT += '.bat' |
30 SDK_TOOLS_DIR = os.path.join(SDK_ROOT_DIR, 'sdk_tools') | 29 SDK_TOOLS_DIR = os.path.join(SDK_ROOT_DIR, 'sdk_tools') |
31 SDK_TOOLS_UPDATE_DIR = os.path.join(SDK_ROOT_DIR, 'sdk_tools_update') | 30 SDK_TOOLS_UPDATE_DIR = os.path.join(SDK_ROOT_DIR, 'sdk_tools_update') |
32 | 31 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 RenameSdkToolsDirectory() | 101 RenameSdkToolsDirectory() |
103 # Call the shell script, just in case this script was updated in the next | 102 # Call the shell script, just in case this script was updated in the next |
104 # version of sdk_tools | 103 # version of sdk_tools |
105 return subprocess.call([NACLSDK_SHELL_SCRIPT] + args) | 104 return subprocess.call([NACLSDK_SHELL_SCRIPT] + args) |
106 else: | 105 else: |
107 return subprocess.call(MakeSdkUpdateMainCmd(args)) | 106 return subprocess.call(MakeSdkUpdateMainCmd(args)) |
108 | 107 |
109 | 108 |
110 if __name__ == '__main__': | 109 if __name__ == '__main__': |
111 sys.exit(main()) | 110 sys.exit(main()) |
OLD | NEW |