summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Brodsky <kevin.brodsky@linaro.org>2015-12-16 11:10:46 +0000
committerVishal Bhoj <vishal.bhoj@linaro.org>2016-01-04 09:17:41 +0530
commit9922315cb2df5e97025b430dd47618e09c6a3226 (patch)
tree3e194ec1e5da77fc1fe6b5a1ce36d8856df28c23
parentdc64acc3b35584243e27bdd9bfbf81647509a6e5 (diff)
Add a PINNED_MANIFEST config variable
If the environment (possibly provided by a build config file) contains PINNED_MANIFEST, it is used to sync the tree with the provided manifest file, instead of tip. This is a first step to support reproducing a given run locally (each run already generated a manifest). Change-Id: Icd3ac738a95bc6814771d8e554add7b140b8ca0c
-rwxr-xr-xsetup-android.sh19
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