diff options
Diffstat (limited to 'scripts/maint/practracker/includes.py')
-rwxr-xr-x | scripts/maint/practracker/includes.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/maint/practracker/includes.py b/scripts/maint/practracker/includes.py index 7d70a6a0aa..e08fd0d706 100755 --- a/scripts/maint/practracker/includes.py +++ b/scripts/maint/practracker/includes.py @@ -136,6 +136,15 @@ class Rules(object): return allowed +def normalize_srcdir(fname): + """given the name of a source directory or file, return its name + relative to `src`. + """ + fname = re.sub(r'^.*/src/', "", fname) + fname = re.sub(r'^src/', "", fname) + fname = re.sub(r'/[^/]*\.[ch]', "", fname) + return fname + include_rules_cache = {} def load_include_rules(fname): @@ -261,6 +270,8 @@ def open_or_stdin(fname): return open(fname) def check_subsys_file(fname, uses_dirs): + uses_dirs = { normalize_srcdir(k) : { normalize_srcdir(d) for d in v } + for (k,v) in uses_dirs.items() } uses_closure = closure(uses_dirs) ok = True previous_subsystems = [] |