Show output from failed install Issue #864

This commit is contained in:
Eric Warnke 2016-10-27 18:08:23 -04:00
parent 461791dddc
commit 8e0723c648

View file

@ -93,7 +93,7 @@ if [ -x "$(command -v apt-get)" ]; then
LIGHTTPD_CFG="lighttpd.conf.debian" LIGHTTPD_CFG="lighttpd.conf.debian"
DNSMASQ_USER="dnsmasq" DNSMASQ_USER="dnsmasq"
package_check_install() { package_check_install() {
dpkg-query -W -f='${Status}' "${1}" 2>/dev/null | grep -c "ok installed" || ${PKG_INSTALL} "${1}" ${PKG_INSTALL} "${1}"
} }
elif [ -x "$(command -v rpm)" ]; then elif [ -x "$(command -v rpm)" ]; then
# Fedora Family # Fedora Family
@ -668,9 +668,10 @@ install_dependent_packages() {
declare -a argArray1=("${!1}") declare -a argArray1=("${!1}")
for i in "${argArray1[@]}"; do for i in "${argArray1[@]}"; do
echo -n "::: Checking for $i..." echo -n "::: Installing $i..."
package_check_install "${i}" &> /dev/null PKG_MGR_OUT=$(package_check_install "${i}" 2>&1 ) && echo "Installed!" || (
echo " installed!" echo "PACKAGE INSTALL ERROR" && echo "$PKG_MGR_OUT" && \
echo "::: Sometimes this can be a transitory error, check connectivity and retry" && exit 1 )
done done
} }