From eda7adbdb24670ea908cb185c451761d2e9d98a0 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Sat, 28 Nov 2026 16:10:30 +0000 Subject: Include apt proxy where possible --- build-arm64.sh | 2 +- build-helpers.sh | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/build-arm64.sh b/build-arm64.sh index ab0e4eb..0a47a20 100755 --- a/build-arm64.sh +++ b/build-arm64.sh @@ -51,7 +51,7 @@ else log_step "arm64: running pi-gen build" pushd "$PI_GEN_DIR" >/dev/null - sudo CLEAN=1 ./build.sh >> "$LOGFILE" 2>&1 + sudo CLEAN=1 APT_PROXY="$APT_PROXY" ./build.sh >> "$LOGFILE" 2>&1 popd >/dev/null log_step "arm64: fixing deploy ownership" diff --git a/build-helpers.sh b/build-helpers.sh index 0e52735..4b38162 100755 --- a/build-helpers.sh +++ b/build-helpers.sh @@ -790,3 +790,23 @@ extract_date() { return 0 } + +# Discover a local APT caching proxy unless explicitly configured. +if [ -z "${APT_PROXY+x}" ]; then + APT_PROXY="" + + if command -v auto-apt-proxy >/dev/null 2>&1; then + APT_PROXY="$(AUTO_APT_PROXY_NO_WAIT_ONLINE=1 \ + AUTO_APT_PROXY_NO_CACHE=1 \ + AUTO_APT_PROXY_AVAHI_NAME=1 \ + auto-apt-proxy)" || APT_PROXY="" + fi +fi + +if [ "$APT_PROXY" = "DIRECT" ]; then + APT_PROXY="" +fi + +export APT_PROXY + +echo "APT proxy: ${APT_PROXY:-Direct connection}" -- cgit v1.2.3