add_c_file: Improve tor source directory checks

Check that the script isn't in a tor build directory, by looking
for a src/include.am file.

Part of 32962.
This commit is contained in:
teor 2020-01-20 13:04:02 +10:00
parent eb336e23a6
commit 0418bc0cb2

View file

@ -265,6 +265,8 @@ def run(fname):
# Make sure we're in the top-level tor directory,
# which contains the src directory
assert(os.path.isdir("src"))
# And it looks like a tor/src directory
assert(os.path.isfile("src/include.am"))
# Make the file name relative to the top-level tor directory
tor_fname = tordir_file(fname)