blob: 31bc958e398210bb2a35fcd27b16b6edb10cc788 [file] [log] [blame]
Patrick Williamsa523cec2022-09-12 16:15:25 -05001#!/bin/env python3
2
3from sh import curl
4from typing import List
5
6ENTERPRISES = {
7 0: "Reserved",
8 2: "IBM",
9 343: "Intel Corporation",
10 674: "Dell Inc.",
11 1694: "HCL Technologies Limited",
12 2487: "Phoenix Technologies Ltd.",
13 4128: "ARM Ltd.",
14 6569: "INVENTEC CORPORATION",
15 7244: "Quanta Computer Inc.",
16 8554: "Departement Elektrotechnik, ETH Zuerich",
17 11129: "Google, Inc.",
18 11183: "Mitac International Corp.",
19 19046: "Lenovo Enterprise Business Group",
20 20974: "American Megatrends, Inc",
21 33049: "Mellanox Technologies LTD",
22 40092: "Wiwynn Corporation",
23 40981: "Facebook, Inc.",
24 42817: "IBM Platform Firmware Division",
25 45065: "Insyde",
26 48482: "Linaro Ltd",
27 48512: "Inspur Group Co.,Ltd.",
28 49150: "Vertiv Co",
29 49769: "YADRO",
30 51974: "Raptor Computing Systems, LLC",
31 52538: "Ampere Computing",
George Liuc328a092022-09-11 14:27:13 +080032 52893: "Inspur Power Systems Co.,Ltd.",
Patrick Williamsa523cec2022-09-12 16:15:25 -050033}
34
35HEADER = '''\
36This file has been reduced to entities signing CLAs with OpenBMC
37https://drive.google.com/drive/folders/1Ooi0RdTcaOWF1DWFJUAJDdN7tRKde7Nl\
38'''
39
40found_first: bool = False
41org: List[str] = []
42
43for l in curl(
44 "-L", "http://www.iana.org/assignments/enterprise-numbers"
45).splitlines():
46 line = l.rstrip()
47
48 # Look for Reserved/EN-0 as the start of the data.
49 if "0" == line:
50 found_first = True
51
52 # Haven't found EN-0, emit as is.
53 if not found_first:
54 print(line)
55 # Look for magic string.
56 if line.startswith("This file is "):
57 print(HEADER)
58 continue
59
60 # Add line into 'org' set.
61 org.append(line)
62
63 # Every 4 lines (EN, Org, Contact, Email) make an org.
64 if len(org) == 4:
65 if int(org[0]) in ENTERPRISES:
66 for g in org:
67 print(g)
68
69 org = []