Log debconf-apt-progress output to show errors in case of failed package install

This commit is contained in:
Orazio 2020-10-27 08:52:51 +01:00
parent bfe611dbf1
commit 4f9349b576

View file

@ -552,9 +552,11 @@ installDependentPackages(){
fi fi
done done
local APTLOGFILE="$(mktemp)"
if command -v debconf-apt-progress > /dev/null; then if command -v debconf-apt-progress > /dev/null; then
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$SUDO debconf-apt-progress -- ${PKG_INSTALL} "${TO_INSTALL[@]}" $SUDO debconf-apt-progress --logfile "${APTLOGFILE}" -- ${PKG_INSTALL} "${TO_INSTALL[@]}"
else else
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$SUDO ${PKG_INSTALL} "${TO_INSTALL[@]}" $SUDO ${PKG_INSTALL} "${TO_INSTALL[@]}"
@ -574,6 +576,7 @@ installDependentPackages(){
done done
if [ "$FAILED" -gt 0 ]; then if [ "$FAILED" -gt 0 ]; then
cat "${APTLOGFILE}"
exit 1 exit 1
fi fi
} }