Skip to content

Instantly share code, notes, and snippets.

@ryo1kato
Created July 11, 2016 03:34
Show Gist options
  • Select an option

  • Save ryo1kato/56be1367452a73f156a099ce10a33241 to your computer and use it in GitHub Desktop.

Select an option

Save ryo1kato/56be1367452a73f156a099ce10a33241 to your computer and use it in GitHub Desktop.
--- Desktop/DB410c_build.sh.txt 2016-07-10 17:16:22.000000000 -0700
+++ Desktop/DB410c_build.sh.txt.new 2016-07-10 19:34:36.000000000 -0700
@@ -8,14 +8,23 @@
CAFTAG="LA.BR.1.2.4-01810-8x16.0.xml"
function SBC410C_SOURCE_CODE() {
-# Do repo sanity test
-if [ $? -eq 0 ]
+if : "run repo sanity test here in the future"
then
echo "Downloading code please wait.."
- repo init -u git://codeaurora.org/platform/manifest.git -b release -m ${CAFTAG} --repo-url=git://codeaurora.org/tools/repo.git
- repo sync -j4
- repo forall -c "git checkout -b master"
- repo forall -c "git checkout -b LA.BR.1.2.4-01810-8x16"
+ repo init -u git://codeaurora.org/platform/manifest.git -b release -m ${CAFTAG} --repo-url=git://codeaurora.org/tools/repo.git ||
+ { echo "ERROR: repo init -u failed." >&2 ; return 1; }
+ repo sync -j4 # ignore error here
+ # for some reason 'repo sync' returns before all git subprocesses completes
+ # we have to wait the subprocesses to exit before running 'git checkout', or it will fail
+ # since there's no easy way to detect that (w/o fixing repo sync), retry "repo forall ..." until it succeeds.
+ local retry=0
+ local max_retry=120;
+ while (( max_retry < retry++ ))
+ do
+ repo forall -c "git checkout -b LA.BR.1.2.4-01810-8x16" && return 0
+ sleep 1
+ done
+ return 1
else
echo "repo tool problem, make sure you have setup your build environment"
echo "1) http://source.android.com/source/initializing.html"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment