mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-09 04:40:06 +00:00
build: Add dist check script that checks if there are unsupported devices
This commit is contained in:
committed by
Marco Trevisan
parent
5113f7ec3b
commit
c890325589
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user