diff mbox

[6/6] build.sh: don't clone ODP if repo is already checked out

Message ID 1431362411-8686-7-git-send-email-zoltan.kiss@linaro.org
State New
Headers show

Commit Message

Zoltan Kiss May 11, 2015, 4:40 p.m. UTC
So developers can use this script on their local copy.

Signed-off-by: Zoltan Kiss <zoltan.kiss@linaro.org>
---
 build.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/build.sh b/build.sh
index eb7328b..2f69bc0 100755
--- a/build.sh
+++ b/build.sh
@@ -161,10 +161,12 @@  if [[ ${BUILD_DEPS} -ge 1 ]]; then
     fi
 fi
 
-echo "Pulling from ${GIT_ODP}, branch ${GIT_BRANCH}"
-remote_name="$(remote_name ${GIT_ODP})"
-odp_fetch "${GIT_ODP}" "${ODP_SRCDIR}" "${remote_name}"
-odp_new_workdir "${ODP_SRCDIR}" "${remote_name}/${GIT_BRANCH}" "${ODP_BUILDDIR}"
+if [ ! -d "$ODP_BUILDDIR" ]; then
+    echo "Pulling from ${GIT_ODP}, branch ${GIT_BRANCH}"
+    remote_name="$(remote_name ${GIT_ODP})"
+    odp_fetch "${GIT_ODP}" "${ODP_SRCDIR}" "${remote_name}"
+    odp_new_workdir "${ODP_SRCDIR}" "${remote_name}/${GIT_BRANCH}" "${ODP_BUILDDIR}"
+fi
 
 # Run cross compile coverty
 coverity_prepare