From 0ecf64d67502119af80c10aeb564c4e4e41789b9 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 1 Sep 2015 13:35:54 +0300 Subject: Use mirror from github to clone git-repo tool The repo tool is normally cloned from google, but in China the url is blocked. Use mirror repo from github by default and add command line parameter to allow using a custom url. Change-Id: I91541fb1e42f8c668f7ff97d29232ca61eb3e20e Reviewed-by: Karim Pinter Reviewed-by: aavit --- b2qt-init-build-env | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'b2qt-init-build-env') diff --git a/b2qt-init-build-env b/b2qt-init-build-env index 0ccd952..a367d31 100755 --- a/b2qt-init-build-env +++ b/b2qt-init-build-env @@ -48,6 +48,10 @@ while test -n "$1"; do shift DEVICE=$1 ;; + "--repo-url") + shift + REPO_URL="--repo-url $1" + ;; *) if [ -n "$COMMAND" ]; then echo "Unknown argument: $1" @@ -70,6 +74,10 @@ if [ -n "${REFERENCE}" ]; then REFERENCE="--reference $(readlink -f ${REFERENCE})" fi +if [ -z "${REPO_URL}" ]; then + REPO_URL="--repo-url git://github.com/theqtcompany/git-repo" +fi + get_repo() { REPO="./repo" if [ -n "$(command -v repo)" ]; then @@ -126,7 +134,7 @@ mirror() { mkdir -p .repo/manifests cp ${DIR}/scripts/manifest.xml .repo/manifests/ MANIFEST="manifest.xml" - ${REPO} init -u ${PWD}/.repo/repo -b default -m ${MANIFEST} -g all --mirror + ${REPO} init ${REPO_URL} -u ${PWD}/.repo/repo -b default -m ${MANIFEST} -g all --mirror ${REPO} sync } @@ -146,7 +154,7 @@ init() { else MANIFEST="manifest.xml" fi - ${REPO} init -u ${PWD}/.repo/repo -b default -m ${MANIFEST} -g "${PROJECT_GROUPS}" ${REFERENCE} + ${REPO} init ${REPO_URL} -u ${PWD}/.repo/repo -b default -m ${MANIFEST} -g "${PROJECT_GROUPS}" ${REFERENCE} ${REPO} sync if [ ! -e "sources/meta-b2qt" ]; then -- cgit v1.2.3-54-g00ecf