Skip to content

Commit 5b2e6c7

Browse files
authored
Merge pull request #30035 from keszybz/buid-sys-cleanups
Build system cleanups
2 parents dfb210c + a05bf18 commit 5b2e6c7

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

hwdb.d/acpi-update.py

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,25 @@
22
# SPDX-License-Identifier: LGPL-2.1-or-later
33

44
from csv import reader
5-
from enum import Enum
65

7-
def read_table(a):
8-
9-
table = []
10-
11-
with open(a, newline='') as csvfile:
12-
for row in reader(csvfile):
13-
if row[0] == "Company":
14-
# Skip header
15-
continue
16-
table.append(row)
6+
# pylint: disable=consider-using-with
177

8+
def read_table(filename):
9+
table = list(reader(open(filename, newline='')))
10+
table = table[1:] # Skip header
1811
table.sort(key=lambda x: x[1])
1912

2013
for row in table:
2114
# Some IDs end with whitespace, while they didn't in the old HTML table, so it's probably
2215
# a mistake, strip it.
23-
print("\nacpi:{0}*:\n ID_VENDOR_FROM_DATABASE={1}".format(row[1].strip(), row[0].strip()))
16+
print(f'\nacpi:{row[1].strip()}*:\n ID_VENDOR_FROM_DATABASE={row[0].strip()}')
2417

25-
print('# This file is part of systemd.\n'
26-
'#\n'
27-
'# Data imported from:\n'
28-
'# https://uefi.org/uefi-pnp-export\n'
29-
'# https://uefi.org/uefi-acpi-export')
18+
print('''\
19+
# This file is part of systemd.
20+
#
21+
# Data imported from:
22+
# https://uefi.org/uefi-pnp-export
23+
# https://uefi.org/uefi-acpi-export''')
3024

31-
read_table("acpi_id_registry.html")
32-
read_table("pnp_id_registry.html")
25+
read_table('acpi_id_registry.csv')
26+
read_table('pnp_id_registry.csv')
File renamed without changes.
File renamed without changes.

test/fuzz/meson.build

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ else
4646
endif
4747

4848
fuzz_c_args = get_option('c_args')
49-
if cxx_cmd != ''
50-
fuzz_cpp_args = get_option('cpp_args')
51-
else
52-
fuzz_cpp_args = []
53-
endif
49+
fuzz_cpp_args = cxx_cmd != '' ? get_option('cpp_args') : []
5450

5551
sanitize_address_undefined = custom_target(
5652
'sanitize-address-undefined-fuzzers',

tools/update-hwdb.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ if [ "${2:-}" != "-n" ]; then (
2121
curl --fail -L -o ma-large.txt 'http://standards-oui.ieee.org/oui/oui.txt'
2222
curl --fail -L -o ma-medium.txt 'http://standards-oui.ieee.org/oui28/mam.txt'
2323
curl --fail -L -o ma-small.txt 'http://standards-oui.ieee.org/oui36/oui36.txt'
24-
curl --fail -L -o pnp_id_registry.html 'https://uefi.org/uefi-pnp-export'
25-
curl --fail -L -o acpi_id_registry.html 'https://uefi.org/uefi-acpi-export'
24+
curl --fail -L -o pnp_id_registry.csv 'https://uefi.org/uefi-pnp-export'
25+
curl --fail -L -o acpi_id_registry.csv 'https://uefi.org/uefi-acpi-export'
2626
) fi
2727

2828
set -x

0 commit comments

Comments
 (0)