summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2021-02-25 09:24:38 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2021-03-10 09:39:44 +0000
commit242578ac6ef807bf20125f0fdd14c5e4cb17e176 (patch)
treea993809c6819e74014e8cb10768c72783fbb23ef /scripts
parent388aa4870a5344505297a18e8fea233f40f12693 (diff)
Integrate the keysym verifier into make check
autotools can't pass arguments, so let's default to 'verify' in the script itself and for distcheck to succeed, we need to set an environment variable to search for the header (it's an out-of-tree build). And due to the very faint chance of there being no python during the xorgproto build, let's make that conditional too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/keysym-generator.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/keysym-generator.py b/scripts/keysym-generator.py
index e0db965..a583e80 100755
--- a/scripts/keysym-generator.py
+++ b/scripts/keysym-generator.py
@@ -13,6 +13,7 @@
import argparse
import logging
+import os
import sys
import re
import libevdev
@@ -385,9 +386,10 @@ def find_xf86keysym_header():
"""
paths = tuple(Path.cwd().glob("**/XF86keysym.h"))
if not paths:
- path = Path("/usr/include/X11/XF86keysym.h")
+ fallbackdir = Path(os.getenv("INCLUDESDIR") or "/usr/include/")
+ path = fallbackdir / "X11" / "XF86keysym.h"
if not path.exists():
- die("Unable to find XF86keysym.h in CWD or /usr")
+ die(f"Unable to find XF86keysym.h in CWD or {fallbackdir}")
else:
if len(paths) > 1:
die("Multiple XF86keysym.h in CWD, please use --header")
@@ -409,7 +411,7 @@ def main():
subparsers = parser.add_subparsers(help="command-specific help", dest="command")
parser_verify = subparsers.add_parser(
- "verify", help="Verify the XF86keysym.h matches requirements"
+ "verify", help="Verify the XF86keysym.h matches requirements (default)"
)
parser_verify.set_defaults(func=verify)
@@ -443,7 +445,8 @@ def main():
ns.header = Path(ns.header)
if ns.command is None:
- parser.error("Invalid or missing command")
+ print("No command specified, defaulting to verify'")
+ ns.func = verify
sys.exit(ns.func(ns))