diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 056a5282..c9ae4cd3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -200,8 +200,11 @@ test_unsupported_list: extends: - .standard_job allow_failure: true + variables: + FPRINT_HWDB_LIST: libfprint/fprint-list-udev-hwdb.c script: - - tests/hwdb-check-unsupported.py + - scripts/sync-unsupported-devices.py $FPRINT_HWDB_LIST + - git diff --color=always --exit-code $FPRINT_HWDB_LIST flatpak: stage: flatpak diff --git a/tests/hwdb-check-unsupported.py b/tests/hwdb-check-unsupported.py deleted file mode 100755 index 650cd099..00000000 --- a/tests/hwdb-check-unsupported.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 - -import os -import sys -import urllib -import urllib.request -import re - -error = False - -try: - response = urllib.request.urlopen('https://gitlab.freedesktop.org/libfprint/wiki/-/wikis/Unsupported-Devices.md') -except: - print("Could not download current list of unsupported devices, skipping test.") - sys.exit(77) -data = response.read().decode('utf-8') - -devices = [] -devices_re = re.compile(r'^.*([0-9a-fA-F]{4}):([0-9a-fA-F]{4}).*$', re.MULTILINE) -for m in devices_re.finditer(data): - vid = m.group(1) - pid = m.group(2) - devices.append((vid, pid)) - -generator = open(os.path.join(os.path.dirname(__file__), '..', 'libfprint', 'fprint-list-udev-hwdb.c')).read() - -id_re = re.compile(' { .vid = 0x([a-fA-F0-9]*), .pid = 0x([a-fA-F0-9]*) }') -# Check everything is the same -started = False -for l in generator.split('\n'): - m = id_re.match(l) - if m is None: - # Stop on the first line that does not match anymore - if started: - break - continue - else: - started = True - - vid_pid = (m.group(1), m.group(2)) - try: - devices.remove(vid_pid) - except ValueError: - print("Generator has entry that is not on wiki: {}:{}".format(*vid_pid)) - error = True - -for vid_pid in devices: - print("New entry from wiki is missing: {}:{}".format(*vid_pid)) - error = True - -if error: - sys.exit(1) -else: - sys.exit(0)