From b750101eb236130cf056c675997decbac904cc49 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:35:18 +0200 Subject: Adding upstream version 252.22. Signed-off-by: Daniel Baumann --- hwdb.d/acpi-update.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 hwdb.d/acpi-update.py (limited to 'hwdb.d/acpi-update.py') diff --git a/hwdb.d/acpi-update.py b/hwdb.d/acpi-update.py new file mode 100755 index 0000000..41670b3 --- /dev/null +++ b/hwdb.d/acpi-update.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-2.1-or-later + +from csv import reader + +# pylint: disable=consider-using-with + +def read_table(filename): + table = list(reader(open(filename, newline=''))) + table = table[1:] # Skip header + table.sort(key=lambda x: x[1]) + + for row in table: + # Some IDs end with whitespace, while they didn't in the old HTML table, so it's probably + # a mistake, strip it. + print(f'\nacpi:{row[1].strip()}*:\n ID_VENDOR_FROM_DATABASE={row[0].strip()}') + +print('''\ +# This file is part of systemd. +# +# Data imported from: +# https://uefi.org/uefi-pnp-export +# https://uefi.org/uefi-acpi-export''') + +read_table('acpi_id_registry.csv') +read_table('pnp_id_registry.csv') -- cgit v1.2.3