Add a helper function to run apt-get
This simplifies the script and allows to log the commands in the build log.
This commit is contained in:
@@ -9,8 +9,13 @@ SUDO=sudo
|
||||
case $(uname -s) in
|
||||
Linux)
|
||||
if [ -f /etc/apt/sources.list ]; then
|
||||
# Disable some (but not all) output.
|
||||
apt_quiet='-q -o=Dpkg::Use-Pty=0'
|
||||
run_apt() {
|
||||
echo "Running apt-get $@"
|
||||
|
||||
# Disable some (but not all) output.
|
||||
$SUDO apt-get -q -o=Dpkg::Use-Pty=0 "$@"
|
||||
|
||||
}
|
||||
|
||||
if [ "$wxUSE_ASAN" = 1 ]; then
|
||||
codename=$(lsb_release --codename --short)
|
||||
@@ -21,7 +26,7 @@ case $(uname -s) in
|
||||
|
||||
# Import the debug symbol archive signing key from the Ubuntu server.
|
||||
# Note that this command works only on Ubuntu 18.04 LTS and newer.
|
||||
$SUDO apt-get $apt_quiet install -y ubuntu-dbgsym-keyring
|
||||
run_apt install -y ubuntu-dbgsym-keyring
|
||||
|
||||
# The key in the package above is currently (2021-03-22) out of
|
||||
# date, so get the latest key manually (this is completely
|
||||
@@ -32,7 +37,7 @@ case $(uname -s) in
|
||||
pkg_install='libfontconfig1-dbgsym libglib2.0-0-dbgsym libgtk-3-0-dbgsym libatk-bridge2.0-0-dbgsym'
|
||||
fi
|
||||
|
||||
$SUDO apt-get $apt_quiet update
|
||||
run_apt update
|
||||
|
||||
case "$wxCONFIGURE_FLAGS" in
|
||||
*--with-directfb*) libtoolkit_dev='libdirectfb-dev' ;;
|
||||
@@ -71,7 +76,7 @@ case $(uname -s) in
|
||||
fi
|
||||
done
|
||||
|
||||
$SUDO apt-get $apt_quiet install -y $pkg_install
|
||||
run_apt install -y $pkg_install
|
||||
fi
|
||||
;;
|
||||
|
||||
|
Reference in New Issue
Block a user