OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 argparse | 6 import argparse |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 import zipfile | 10 import zipfile |
11 | 11 |
12 _PLATFORMS = ["linux-x64", "android-arm"] | 12 _PLATFORMS = ["linux-x64", "android-arm"] |
13 _APPS = ["network_service", "network_service_apptests"] | 13 _APPS = ["network_service", "network_service_apptests"] |
14 _CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) | 14 _CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) |
15 sys.path.insert(0, os.path.join(_CURRENT_PATH, "pylib")) | 15 sys.path.insert(0, os.path.join(_CURRENT_PATH, "pylib")) |
16 import gs | 16 import gs |
17 | 17 |
18 if not sys.platform.startswith("linux"): | |
19 print "Not supported for your platform" | |
20 sys.exit(0) | |
21 | |
22 script_dir = os.path.dirname(os.path.realpath(__file__)) | 18 script_dir = os.path.dirname(os.path.realpath(__file__)) |
23 | 19 |
24 | 20 |
25 def download_app(app, version, tools_directory): | 21 def download_app(app, version, tools_directory): |
26 prebuilt_directory = os.path.join(script_dir, "prebuilt/%s" % app) | 22 prebuilt_directory = os.path.join(script_dir, "prebuilt/%s" % app) |
27 stamp_path = os.path.join(prebuilt_directory, "VERSION") | 23 stamp_path = os.path.join(prebuilt_directory, "VERSION") |
28 | 24 |
29 try: | 25 try: |
30 with open(stamp_path) as stamp_file: | 26 with open(stamp_path) as stamp_file: |
31 current_version = stamp_file.read().strip() | 27 current_version = stamp_file.read().strip() |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 version = version_file.read().strip() | 76 version = version_file.read().strip() |
81 | 77 |
82 for app in _APPS: | 78 for app in _APPS: |
83 download_app(app, version, args.tools_directory) | 79 download_app(app, version, args.tools_directory) |
84 | 80 |
85 return 0 | 81 return 0 |
86 | 82 |
87 | 83 |
88 if __name__ == "__main__": | 84 if __name__ == "__main__": |
89 sys.exit(main()) | 85 sys.exit(main()) |
OLD | NEW |