]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
add_c_file: Improve tor source directory checks
authorteor <teor@torproject.org>
Mon, 20 Jan 2020 03:04:02 +0000 (13:04 +1000)
committerteor <teor@torproject.org>
Mon, 20 Jan 2020 03:04:02 +0000 (13:04 +1000)
Check that the script isn't in a tor build directory, by looking
for a src/include.am file.

Part of 32962.

scripts/maint/add_c_file.py

index 25a1be5331d246c8ff5f32f9c90351659580d223..a7478cbecfb30fb30d489b763180cf0cbd1a2814 100755 (executable)
@@ -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)