--- /usr/sbin/qtp-install-watchall	2009-10-03 18:53:10.000000000 +0200
+++ /usr/sbin/qtp-install-watchall.new	2010-01-27 15:40:18.000000000 +0100
@@ -12,7 +12,18 @@
 sleep 2
 
+# Keeping track of number of installed packages
+installed=0
+
 ## Check to see if ncurses-devel is already installed, if not, yum it
 if [ ! -d /usr/include/ncurses ]; then
 	yum -y install ncurses-devel >/dev/null 2>&1
+	# Can't check exit code since yum returns zero even if the package doesn't exist
+	if [ ! -d /usr/include/ncurses ]; then
+		echo "Failed to install ncurses-devel - aborting"
+		exit 1
+        else 
+		echo "Installed ncurses-devel successfully"
+                installed=$(($installed+1))
+	fi
 fi
 
@@ -25,4 +36,18 @@
 #	rpm -Uvh /usr/src/redhat/RPMS/i386/multitail-* >/dev/null 2>&1
 	yum -y install multitail >/dev/null 2>&1
+
+	# Can't check exit code since yum returns zero even if the package doesn't exist
+	if [ ! -e /usr/bin/multitail ]; then
+		echo "Failed to install multitail - aborting"
+		exit 1
+        else 
+		echo "Installed multitail successfully"
+                installed=$(($installed+1))
+	fi
+fi
+
+
+if [ $installed -eq 0 ]; then
+	echo "All dependencies were already installed - continuing"
 fi
 

