| 191 | |
| 192 | |
| 193 | def check_host(args) -> int: |
| 194 | args.host = os.environ.get('HOST', subprocess.check_output( |
| 195 | './depends/config.guess').decode()) |
| 196 | if args.download_binary: |
| 197 | platforms = { |
| 198 | 'aarch64-*-linux*': 'aarch64-linux-gnu', |
| 199 | 'x86_64-*-linux*': 'x86_64-linux-gnu', |
| 200 | 'x86_64-apple-darwin*': 'osx64', |
| 201 | 'aarch64-apple-darwin*': 'osx64', |
| 202 | } |
| 203 | args.platform = '' |
| 204 | for pattern, target in platforms.items(): |
| 205 | if fnmatch(args.host, pattern): |
| 206 | args.platform = target |
| 207 | if not args.platform: |
| 208 | print('Not sure which binary to download for {}'.format(args.host)) |
| 209 | return 1 |
| 210 | return 0 |
| 211 | |
| 212 | |
| 213 | def main(args) -> int: |