Unify check_repo_path

We had 4 identical copies of the check_repo_path function. Replace them by a
single copy in the build_tree module where it naturally belongs.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/scripts/abi_check.py b/scripts/abi_check.py
index c228843..ac1d60f 100755
--- a/scripts/abi_check.py
+++ b/scripts/abi_check.py
@@ -113,6 +113,8 @@
 
 import xml.etree.ElementTree as ET
 
+from mbedtls_dev import build_tree
+
 
 class AbiChecker:
     """API and ABI checker."""
@@ -150,11 +152,6 @@
         self.git_command = "git"
         self.make_command = "make"
 
-    @staticmethod
-    def check_repo_path():
-        if not all(os.path.isdir(d) for d in ["include", "library", "tests"]):
-            raise Exception("Must be run from Mbed TLS root")
-
     def _setup_logger(self):
         self.log = logging.getLogger()
         if self.verbose:
@@ -540,7 +537,7 @@
     def check_for_abi_changes(self):
         """Generate a report of ABI differences
         between self.old_rev and self.new_rev."""
-        self.check_repo_path()
+        build_tree.check_repo_path()
         if self.check_api or self.check_abi:
             self.check_abi_tools_are_installed()
         self._get_abi_dump_for_ref(self.old_version)