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