diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-04-04 11:31:30 -0400 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-04-07 17:35:58 +1000 |
commit | 5f49695f94abd089dfbaa2e219ac277aa5c15242 (patch) | |
tree | c4ceadbb50a854efabb56bb7237bcb58df98ec54 /scripts/maint | |
parent | f9c57313d03abccbbbcffc808464365500baced8 (diff) | |
download | tor-5f49695f94abd089dfbaa2e219ac277aa5c15242.tar.gz tor-5f49695f94abd089dfbaa2e219ac277aa5c15242.zip |
Make check_subsystem_order work in out-of-tree builds.
Diffstat (limited to 'scripts/maint')
-rwxr-xr-x | scripts/maint/practracker/includes.py | 11 | ||||
-rwxr-xr-x | scripts/maint/run_check_subsystem_order.sh | 2 |
2 files changed, 12 insertions, 1 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 = [] diff --git a/scripts/maint/run_check_subsystem_order.sh b/scripts/maint/run_check_subsystem_order.sh index 1e68b9d008..4ec73bfd56 100755 --- a/scripts/maint/run_check_subsystem_order.sh +++ b/scripts/maint/run_check_subsystem_order.sh @@ -12,6 +12,6 @@ if ! test -x "${INCLUDES_PY}" ; then fi "${TOR}" --dbg-dump-subsystem-list | \ - "${INCLUDES_PY}" --check-subsystem-order - + "${INCLUDES_PY}" --check-subsystem-order - "${abs_top_srcdir}/src" echo ok |