Skip to content

Commit

Permalink
doc: extensions: boards: Better handle unknown/other vendors
Browse files Browse the repository at this point in the history
Boards under a folder that doesn't directly match a vendor prefix
incorrectly end up being categorized as "zephyr" since that's the only
prefix that is eventually found when navigating up the folder hierarchy.

This commits treats boards in the "others" and "native" folders as
special cases and associates them to an "Unknown/Other" category.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
  • Loading branch information
kartben authored and carlescufi committed Oct 23, 2024
1 parent b8c18f5 commit c9b7104
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions doc/_scripts/gen_boards_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,13 @@ def get_catalog():

for board in boards:
# We could use board.vendor but it is often incorrect. Instead, deduce vendor from
# containing folder
# containing folder. There are a few exceptions, like the "native" and "others" folders
# which we know are not actual vendors so treat them as such.
for folder in board.dir.parents:
if vnd_lookup.vnd2vendor.get(folder.name):
if folder.name in ["native", "others"]:
vendor = "others"
break
elif vnd_lookup.vnd2vendor.get(folder.name):
vendor = folder.name
break

Expand Down Expand Up @@ -118,4 +122,8 @@ def get_catalog():
series = soc.series or "<no series>"
socs_hierarchy.setdefault(family, {}).setdefault(series, []).append(soc.name)

return {"boards": board_catalog, "vendors": vnd_lookup.vnd2vendor, "socs": socs_hierarchy}
return {
"boards": board_catalog,
"vendors": {**vnd_lookup.vnd2vendor, "others": "Other/Unknown"},
"socs": socs_hierarchy,
}

0 comments on commit c9b7104

Please sign in to comment.