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:
Vadim Zeitlin
2021-03-23 12:23:39 +01:00
parent d61719edde
commit 9cb28353e7

View File

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