aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-scripts/build-android3
-rw-r--r--build-scripts/helpers12
2 files changed, 13 insertions, 2 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index 392dbcf..81578b0 100644
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -18,11 +18,10 @@ if [ -n "$BUILD_COPYCAT" ]; then
else
+ set_proxy_if_accessible
if [ -n "$REPO_SEED_URL" ]; then
- export http_proxy=http://ci.linaro.org:3128/
repo-sync-from-seed "${1}"
else
- export http_proxy=http://ci.linaro.org:3128/
repo-sync-from-mirror "${1}"
fi
diff --git a/build-scripts/helpers b/build-scripts/helpers
index ac0c251..be86bc0 100644
--- a/build-scripts/helpers
+++ b/build-scripts/helpers
@@ -181,3 +181,15 @@ product2lamc_dev () {
echo -n "$1";;
esac
}
+
+# Check if a proxy is accessible using wget.
+set_proxy_if_accessible() {
+ proxy_address=http://ci.linaro.org:3128/
+ export http_proxy=$proxy_address
+ wget -q -O /dev/null --timeout=10 http://android.git.linaro.org/ || unset http_proxy
+ if [ -z "$http_proxy" ]; then
+ echo "WARNING: Proxy at $proxy_address doesn't work."
+ else
+ echo "INFO: http_proxy set to '$http_proxy'."
+ fi
+}