if HAVE_PYTHON
TESTS += \
- test/rule-syntax-check.py
+ test/rule-syntax-check.py \
+ hwdb/parse_hwdb.py
if HAVE_SYSV_COMPAT
TESTS += \
test/udev-test.pl \
test/rule-syntax-check.py \
test/sysv-generator-test.py \
- test/mocks/fsck
+ test/mocks/fsck \
+ hwdb/parse_hwdb.py
# ------------------------------------------------------------------------------
ata_id_SOURCES = \
+#!/usr/bin/python3
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
-import sys
-import string
import functools
+import glob
+import string
+import sys
+import os
try:
from pyparsing import (Word, White, Literal, ParserElement, Regex,
stringEnd, pythonStyleComment,
ParseBaseException)
except ImportError:
- sys.exit('pyparsing is not available')
+ print('pyparsing is not available')
+ sys.exit(77)
try:
from evdev.ecodes import ecodes
))
if __name__ == '__main__':
- for fname in sys.argv[1:]:
+ args = sys.argv[1:] or glob.glob(os.path.dirname(sys.argv[0]) + '/[67]0-*.hwdb')
+
+ for fname in args:
groups = parse(fname)
print_summary(fname, groups)
check_match_uniqueness(groups)