Allow the script to be run from inside the packaging dir.

This commit is contained in:
Wayne Davison
2021-10-01 13:23:30 -07:00
parent ae1f002999
commit 050fdd4126

View File

@@ -4,7 +4,7 @@
# for vars that are defined but not used, and for inconsistent array
# sizes. Run it from inside the main rsync directory.
import re, argparse, glob
import os, sys, re, argparse, glob
VARS_RE = re.compile(r'^(?!(?:extern|enum)\s)([a-zA-Z]\S*\s+.*);', re.M)
EXTERNS_RE = re.compile(r'^extern\s+(.*);', re.M)
@@ -15,6 +15,13 @@ def main():
add_syscall_c = set('t_stub.c t_unsafe.c tls.c trimslash.c'.split())
add_util_c = set('t_stub.c t_unsafe.c'.split())
if not os.path.exists('syscall.c'):
if os.path.exists('var-checker'):
os.chdir('..')
else:
print("Couldn't find the source dir.")
sys.exit(1)
syscall_c = slurp_file('syscall.c', True)
util_c = slurp_file('util1.c', True)