From 4dbf6bdf061ee87e2855636ee263dd24f0777378 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Sat, 22 Feb 2020 23:17:18 -0500 Subject: more schroot config --- etc/schroot/setup.d/60append-apt-sources | 34 ++++++++++++++++++++++++++++++++ etc/schroot/setup.d/80append-apt-sources | 13 ++++++++++++ 2 files changed, 47 insertions(+) create mode 100755 etc/schroot/setup.d/60append-apt-sources create mode 100755 etc/schroot/setup.d/80append-apt-sources (limited to 'etc') diff --git a/etc/schroot/setup.d/60append-apt-sources b/etc/schroot/setup.d/60append-apt-sources new file mode 100755 index 0000000..c98b8ce --- /dev/null +++ b/etc/schroot/setup.d/60append-apt-sources @@ -0,0 +1,34 @@ +#!/bin/sh +# https://www.pseudorandom.co.uk/2007/sbuild/ +# /etc/schroot/setup.d/60append-apt-sources + +AUTH_VERBOSITY="verbose" + +if [ $1 = "setup-start" ] || [ $1 = "setup-recover" ]; then + + NAME=$(echo "${CHROOT_NAME}" | sed -e 's/-[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9]-[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]//g') + + EXTRA_APT_SOURCES="/etc/schroot/sources.list.d/${NAME}.sources.list" + APT_PREFS="/etc/schroot/sources.list.d/${NAME}.preferences" + + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "Checking for auxiliary apt sources in $EXTRA_APT_SOURCES" >&2 + fi + if [ -e "$EXTRA_APT_SOURCES" ]; then + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "... extra apt sources found" >&2 + fi + cat "$EXTRA_APT_SOURCES" >> "${CHROOT_PATH}/etc/apt/sources.list" + fi + + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "Checking for apt preferences in $APT_PREFS" >&2 + fi + if [ -e "$APT_PREFS" ]; then + if [ "$AUTH_VERBOSITY" = "verbose" ]; then + echo "... apt preferences found" >&2 + fi + install -m644 "$APT_PREFS" "${CHROOT_PATH}/etc/apt/preferences" + fi + +fi diff --git a/etc/schroot/setup.d/80append-apt-sources b/etc/schroot/setup.d/80append-apt-sources new file mode 100755 index 0000000..953a5b1 --- /dev/null +++ b/etc/schroot/setup.d/80append-apt-sources @@ -0,0 +1,13 @@ +#!/bin/sh +# /etc/schroot/setup.d/80apt-get-update + +EXTRA_APT_SOURCES="/etc/schroot/sources.list.d/${CHROOT_NAME}.sources.list" +APT_PREFS="/etc/schroot/sources.list.d/${CHROOT_NAME}.preferences" + +if [ -f "EXTRA_APT_SOURCES" -a $1 = "setup-start" ]; then + if : || [ "$AUTH_VERBOSITY" = "verbose" ]; then + chroot "${CHROOT_PATH}" apt-get update >&2 || true + else + chroot "${CHROOT_PATH}" apt-get update >/dev/null || true + fi +fi -- cgit v1.2.3