#!/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
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
本文介绍了一个用于下载并同步Android源代码的bash脚本。该脚本首先检查是否存在名为repo的文件,若不存在则从Google服务器下载。下载完成后,赋予repo文件执行权限,并将其添加到系统路径中。接着初始化并同步Android源代码。
3074






