no error on missing packages
yum does not error if a package in the list does not exists. so according to : server Fault and bugxilla redhat#736694 posible solution:
# Loop over the packages in the list:
for pkg in ${pkgs_to_install}; do
# Stop executing if at least one package isn't available:
yum info ${pkg} >> /dev/null 2>&1 || exit
done
Implement!
Edited by Danny