From 8e0723c648e96b9e2b3ed3a637e77ce7fc9846a0 Mon Sep 17 00:00:00 2001 From: Eric Warnke Date: Thu, 27 Oct 2016 18:08:23 -0400 Subject: [PATCH] Show output from failed install Issue #864 --- automated install/basic-install.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 29ff0159..bd650fee 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -93,7 +93,7 @@ if [ -x "$(command -v apt-get)" ]; then LIGHTTPD_CFG="lighttpd.conf.debian" DNSMASQ_USER="dnsmasq" 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 # Fedora Family @@ -668,9 +668,10 @@ install_dependent_packages() { declare -a argArray1=("${!1}") for i in "${argArray1[@]}"; do - echo -n "::: Checking for $i..." - package_check_install "${i}" &> /dev/null - echo " installed!" + echo -n "::: Installing $i..." + PKG_MGR_OUT=$(package_check_install "${i}" 2>&1 ) && 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 }