From c8903255895f290e4f9c9a00b6eace2a6b9467b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Thu, 2 Jul 2026 18:07:07 +0200 Subject: [PATCH] build: Add dist check script that checks if there are unsupported devices --- meson.build | 2 ++ scripts/sync-unsupported-devices.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/meson.build b/meson.build index 3f1d2ecf..9e0e575c 100644 --- a/meson.build +++ b/meson.build @@ -334,6 +334,8 @@ subdir('tests') subdir('examples') +meson.add_dist_script(sync_unsupported_files, '--check', udev_hwdb_list_file) + pkgconfig = import('pkgconfig') pkgconfig.generate( name: versioned_libname, diff --git a/scripts/sync-unsupported-devices.py b/scripts/sync-unsupported-devices.py index d0b55e17..11b45fdd 100755 --- a/scripts/sync-unsupported-devices.py +++ b/scripts/sync-unsupported-devices.py @@ -4,6 +4,7 @@ # fprint-list-udev-hwdb.c from the libfprint wiki page. import argparse +import os import re import sys from urllib.request import urlopen @@ -40,6 +41,11 @@ def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("source_file", help="Path to hwdb file") parser.add_argument("--url", default=DEFAULT_URL, help="Wiki page URL") + parser.add_argument( + "--check", + action="store_true", + help="Do not modify files, fail if an update is needed", + ) args = parser.parse_args() entries = parse_entries(fetch(args.url)) @@ -61,6 +67,10 @@ def main(): print("allowlist_id_table is already up to date") return + if args.check: + print("allowlist_id_table is out of date", file=sys.stderr) + sys.exit(1) + with open(args.source_file, "w", encoding="utf-8") as f: f.write(new_content)