From 0b4b2f17288eb676a5bfdb7041e947309e678dff Mon Sep 17 00:00:00 2001
From: Jannis Konrad <kabel42@gmail.com>
Date: Fri, 15 Sep 2017 10:28:03 +0200
Subject: [PATCH] only run "git submodule update --init" if tinydtls is not yet
 checked out

---
 setup.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index ecde60d..36148f1 100644
--- a/setup.py
+++ b/setup.py
@@ -10,13 +10,14 @@ class prepare_tinydtls(build_ext):
     def run(self):
         def run_command(args):
             print("Running:", " ".join(args))
-            subprocess.check_call(args, cwd=os.path.join(os.path.dirname(__file__), "./DTLSSocket/tinydtls"))
+            subprocess.check_call(args, cwd=os.path.join(os.path.dirname(__file__), "DTLSSocket','tinydtls"))
         commands = [
-            ["git", "submodule", "update", "--init"],
             ["autoconf"],
             ["autoheader"],
             ["./configure", "--without-ecc"],
             ]
+        if not os.path.exists(os.path.join(os.path.dirname(__file__), 'DTLSSocket','tinydtls','dtls.c')):
+            ["git", "submodule", "update", "--init"],
         for command in commands:
             run_command(command)
         build_ext.run(self)
-- 
GitLab