防止android源码下载异常的脚本

来源:互联网 发布:Linux 格式化 ext4 编辑:程序博客网 时间:2024/04/29 12:18

原文链接地址:http://blog.csdn.net/wonview/article/details/7364209

#!/bin/bash


if [ ! -f repo ];then
    # download repo to $PWD
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ./repo
fi
chmod a+x ./repo
PATH=.:$PATH

repo init -u git://android.git.kernel.org/platform/manifest.git -b master
repo sync

while [ $? = 1 ]; do
    echo "==================repo sync failed, do it again"
    sleep 3
    repo sync
done

echo "===================sync done"

exit 0