| 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 |
| 18 script_dir = os.path.dirname(os.path.realpath(__file__)) | 22 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 19 | 23 |
| 20 | 24 |
| 21 def download_app(app, version, tools_directory): | 25 def download_app(app, version, tools_directory): |
| 22 prebuilt_directory = os.path.join(script_dir, "prebuilt/%s" % app) | 26 prebuilt_directory = os.path.join(script_dir, "prebuilt/%s" % app) |
| 23 stamp_path = os.path.join(prebuilt_directory, "VERSION") | 27 stamp_path = os.path.join(prebuilt_directory, "VERSION") |
| 24 | 28 |
| 25 try: | 29 try: |
| 26 with open(stamp_path) as stamp_file: | 30 with open(stamp_path) as stamp_file: |
| 27 current_version = stamp_file.read().strip() | 31 current_version = stamp_file.read().strip() |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 version = version_file.read().strip() | 80 version = version_file.read().strip() |
| 77 | 81 |
| 78 for app in _APPS: | 82 for app in _APPS: |
| 79 download_app(app, version, args.tools_directory) | 83 download_app(app, version, args.tools_directory) |
| 80 | 84 |
| 81 return 0 | 85 return 0 |
| 82 | 86 |
| 83 | 87 |
| 84 if __name__ == "__main__": | 88 if __name__ == "__main__": |
| 85 sys.exit(main()) | 89 sys.exit(main()) |
| OLD | NEW |