From c3f6a561e2fcda5b41569e7bf7785fad825d3a72 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 5 Aug 2016 15:07:41 -0400 Subject: build-sys: hook up the hwdb parser to check --- hwdb/parse_hwdb.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) mode change 100644 => 100755 hwdb/parse_hwdb.py (limited to 'hwdb') diff --git a/hwdb/parse_hwdb.py b/hwdb/parse_hwdb.py old mode 100644 new mode 100755 index 773513eaf0..99d034b4e0 --- a/hwdb/parse_hwdb.py +++ b/hwdb/parse_hwdb.py @@ -1,3 +1,4 @@ +#!/usr/bin/python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # This file is part of systemd. @@ -17,9 +18,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . -import sys -import string import functools +import glob +import string +import sys +import os try: from pyparsing import (Word, White, Literal, ParserElement, Regex, @@ -29,7 +32,8 @@ try: 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 @@ -168,7 +172,9 @@ def print_summary(fname, groups): )) 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) -- cgit v1.2.3-54-g00ecf