diff options
Diffstat (limited to 'setup-android.sh')
-rwxr-xr-x | setup-android.sh | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/setup-android.sh b/setup-android.sh index 9f6775a..67824b7 100755 --- a/setup-android.sh +++ b/setup-android.sh @@ -71,7 +71,7 @@ else fi # Should contain at least: {LOCAL_,}MANIFEST_{URL,BRANCH} -# Optionally: REPO_SEED_DIR, PATCHSETS +# Optionally: REPO_SEED_DIR, PATCHSETS, PINNED_MANIFEST # And other configuration variables used in the scripts . $build_config_dir/$BUILD_CONFIG_FILENAME @@ -104,33 +104,36 @@ REPO_START=$(date +%s.%N) repo init -u $MANIFEST_URL -g $REPO_GROUPS -b $MANIFEST_BRANCH \ ${REPO_SEED_DIR:+--reference="$REPO_SEED_DIR"} -if [[ $LOCAL_MANIFEST_URL ]]; then - cd .repo - rm -rf local_manifests +cd .repo +rm -rf local_manifests +# If a pinned manifest is used, the local manifest must not be used as it would +# be conflicting (the pinned manifest already incorporates Linaro repos) +if [[ $LOCAL_MANIFEST_URL && ! $PINNED_MANIFEST ]]; then git clone $LOCAL_MANIFEST_URL -b $LOCAL_MANIFEST_BRANCH local_manifests - cd - fi +cd - rm -rf art/ build/ external/vixl set +e # Download the code -repo sync --force-sync -j$cpu_count > "$WORKSPACE/sync-logs.txt" 2>&1 +sync_args=(--force-sync ${PINNED_MANIFEST:+-m "$PINNED_MANIFEST"}) +repo sync "${sync_args[@]}" -j$cpu_count > "$WORKSPACE/sync-logs.txt" 2>&1 repo_sync_status=$? if [[ $repo_sync_status -ne 0 ]]; then for (( repo_sync_tries = 1; repo_sync_tries <= 3 && repo_sync_status != 0; \ ++repo_sync_tries )); do echo "Retry #$repo_sync_tries" >> "$WORKSPACE/sync-logs.txt" - repo sync --force-sync -j2 >> "$WORKSPACE/sync-logs.txt" 2>&1 + repo sync "${sync_args[@]}" -j2 >> "$WORKSPACE/sync-logs.txt" 2>&1 repo_sync_status=$? 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 "${sync_args[@]}" -j2 >> "$WORKSPACE/sync-logs.txt" 2>&1 repo_sync_status=$? if [[ $repo_sync_status -ne 0 ]]; then |