Factor out submodule presence checking.
[mat/samba.git] / third_party / wscript
index d41b90698ed72699f843410157a750a8d1ff0605..d5b9df7bb965ae75028342ec242a1bcfb4d4b27f 100644 (file)
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+import samba_git
 import Utils
 import os
 import sys
@@ -27,8 +28,7 @@ def find_third_party_module(conf, module, package):
         try:
             __import__(module)
         except ImportError:
-            if (os.path.isdir(os.path.join(conf.srcdir, ".git")) and
-                os.path.isfile(os.path.join(conf.srcdir, ".gitmodule"))):
+            if samba_git.has_submodules(conf.srcdir):
                 raise Utils.WafError("""\
 Unable to find Python module '%s'. Please install the system package or check \
 out the relevant submodule by running 'git submodule update --init'.