diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-03-26 12:30:30 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-03-26 12:30:30 -0400 |
commit | 978b7ef45c21169a01a81cd1b206530cbcd47fe2 (patch) | |
tree | 88e2ee93ee27279dab8fddc96055b007acc3ffae /scripts/maint | |
parent | a40d539f7cce851a4a66c68a14917e1681972475 (diff) | |
download | tor-978b7ef45c21169a01a81cd1b206530cbcd47fe2.tar.gz tor-978b7ef45c21169a01a81cd1b206530cbcd47fe2.zip |
Teach --check-subsystem-order to take input from stdin
Diffstat (limited to 'scripts/maint')
-rwxr-xr-x | scripts/maint/practracker/includes.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/maint/practracker/includes.py b/scripts/maint/practracker/includes.py index 7af378d5c0..7d70a6a0aa 100755 --- a/scripts/maint/practracker/includes.py +++ b/scripts/maint/practracker/includes.py @@ -254,11 +254,18 @@ def walk_c_files(topdir="src"): for err in consider_include_rules(fullpath, f): yield err +def open_or_stdin(fname): + if fname == '-': + return sys.stdin + else: + return open(fname) + def check_subsys_file(fname, uses_dirs): uses_closure = closure(uses_dirs) ok = True previous_subsystems = [] - with open(fname) as f: + + with open_or_stdin(fname) as f: for line in f: _, name, fname = line.split() fname = re.sub(r'^.*/src/', "", fname) |