diff options
| -rwxr-xr-x | build-arm64.sh | 2 | ||||
| -rwxr-xr-x | build-helpers.sh | 20 |
2 files changed, 21 insertions, 1 deletions
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}" |
