summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Díaz <daniel.diaz@linaro.org>2015-12-04 11:04:38 -0600
committerDaniel Díaz <daniel.diaz@linaro.org>2015-12-04 11:06:21 -0600
commit5121a09c9e71f019ed819aae62bcd1af273e05c9 (patch)
tree1ab202ac38275cc08165d12221822b8c384520dd
parent73ff62becc6ac6cac55d9ed599cb551087eb9567 (diff)
downloadart-build-tests.sh-reposupersync.tar.gz
Try and retry to do a correct repo sync.reposupersync
Change-Id: I813c4a5b0b84222008b0820e67f8152192cabfa2 Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
-rwxr-xr-xsetup-android.sh27
1 files changed, 23 insertions, 4 deletions
diff --git a/setup-android.sh b/setup-android.sh
index a67655e..c10e293 100755
--- a/setup-android.sh
+++ b/setup-android.sh
@@ -96,11 +96,30 @@ set +e
# Download the code
repo sync --force-sync -j${cpu_count} > $WORKSPACE/sync-logs.txt 2>&1
+repo_sync_status=$?
+
+if [ ${repo_sync_status} -ne 0 ]; then
+ repo_sync_tries=1
+ while [ ${repo_sync_tries} -le 3 -a ${repo_sync_status} -ne 0 ]; do
+ echo "Retry #${repo_sync_tries}" >> $WORKSPACE/sync-logs.txt
+ repo sync --force-sync -j2 >> $WORKSPACE/sync-logs.txt 2>&1
+ repo_sync_status=$?
+ repo_sync_tries=$((repo_sync_tries+1))
+ done
+
+ if [ ${repo_sync_status} -ne 0 ]; then
+ echo "Starting over with repo sync" >> $WORKSPACE/sync-logs.txt
+ rm -rf .repo/project*
+ repo sync --force-sync -j2 >> $WORKSPACE/sync-logs.txt 2>&1
+ repo_sync_status=$?
+
+ if [ ${repo_sync_status} -ne 0 ]; then
+ echo "Error: *** Error repo sync definitely failed"
+ cat $WORKSPACE/sync-logs.txt
+ exit -1
+ fi
+ fi
-if [ $? -ne 0 ]; then
- echo "Error: *** Error repo sync failed"
- cat $WORKSPACE/sync-logs.txt
- exit -1
fi
if [ -n "$SOURCE_OVERLAY" ]; then