From 08f0ae1224de7acdb29611df192b096ebc8f2c76 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Fri, 25 Feb 2022 11:15:41 +0000 Subject: Add mirror and keyring support to install_pulseaudio_sources_apt_wrapper.sh --- scripts/install_pulseaudio_sources_apt_wrapper.sh | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/scripts/install_pulseaudio_sources_apt_wrapper.sh b/scripts/install_pulseaudio_sources_apt_wrapper.sh index 27331cf..04d336f 100755 --- a/scripts/install_pulseaudio_sources_apt_wrapper.sh +++ b/scripts/install_pulseaudio_sources_apt_wrapper.sh @@ -19,6 +19,10 @@ # Wrapper to call install_pulseaudio_sources.sh and tidy up afterwards +# The command line switches --mirror= and --keyring= can be specified if +# these switches are needed for a system based on Debian (e.g. a Raspberry +# Pi) + # --------------------------------------------------------------------------- # G L O B A L S # --------------------------------------------------------------------------- @@ -98,6 +102,29 @@ RunWrappedScript() # M A I N # ----------------------------------------------------------------------------- +debootstrap_mirror="" +debootstrap_switches="" + +# Parse command line switches +while [ -n "$1" ]; do + case "$1" in + --mirror=*) + debootstrap_mirror="${1#--mirror=}" + ;; + --keyring=*) + file="${1#--keyring=}" + if [ -f "$file" ]; then + debootstrap_switches="$debootstrap_switches $1" + else + echo "** Ignoring missing keyring $1" >&2 + fi + ;; + *) echo "** Unrecognised parameter '$1'" >&2 + exit 1 + esac + shift +done + # Start with a few sanity checks if [ -d $PULSE_DIR ]; then echo "** Target directory $PULSE_DIR already exists" >&2 @@ -127,8 +154,10 @@ fi # Create the build root log=/var/tmp/pa-build-$USER-debootstrap.log echo "- Creating $distro build root. Log file in $log" -sudo debootstrap $distro $BUILDROOT >$log 2>&1 || { - echo "** debootstrap failed. Check log file" >&2 +sudo debootstrap \ + $debootstrap_switches \ + $distro $BUILDROOT "$debootstrap_mirror" >$log 2>&1 || { + echo "** debootstrap failed. Check log file $log" >&2 exit 1 } @@ -159,7 +188,7 @@ sudo chmod +x $BUILDROOT/wrapped_script || exit $? log=/var/tmp/pa-build-$USER-schroot.log echo "- Building PA sources. Log file in $log" RunWrappedScript >$log 2>&1 || { - echo "** schroot failed. Check log file" >&2 + echo "** schroot failed. Check log file $log" >&2 exit 1 } -- cgit v1.2.3