From 416093beece6a60e24d65b5bf4e984c812ab7a9a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 29 Apr 2018 21:42:41 +0100 Subject: [PATCH] Use a public-facing mirror URL in the final buildd /etc/apt/sources.list. --- live-build/auto/config | 2 +- live-build/buildd/hooks/mirror.binary | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 live-build/buildd/hooks/mirror.binary diff --git a/live-build/auto/config b/live-build/auto/config index 4fd845ff..d6fbf531 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -677,7 +677,7 @@ case $SUBPROJECT in OPTS="${OPTS:+$OPTS }--apt-secure false" OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none" INITRAMFS_COMPRESSION=none - OPTS="${OPTS:+$OPTS }--mirror-binary ${MIRROR}" + OPTS="${OPTS:+$OPTS }--parent-mirror-binary ${MIRROR}" # XXX cjwatson 2018-04-27: We need to work out how to make # this conditional so that we can do things like building # buildd chroots with -updates. This probably involves diff --git a/live-build/buildd/hooks/mirror.binary b/live-build/buildd/hooks/mirror.binary new file mode 100755 index 00000000..5aea13d0 --- /dev/null +++ b/live-build/buildd/hooks/mirror.binary @@ -0,0 +1,12 @@ +#! /bin/sh +set -e + +. config/bootstrap + +# Use a public-facing mirror URL, for the benefit of +# sbuild-launchpad-chroot. We deliberately do this only after live-build +# has run "apt-get update" for the last time, in order that +# /var/lib/apt/lists/ has suitable cached Packages files; this speeds up +# builds on buildds. +sed "s,${LB_PARENT_MIRROR_BINARY},${LB_MIRROR_BINARY},g" \ + binary/etc/apt/sources.list