Make kickstart.package.installed return the status

Using `&&` was making the command only return when all the packages were
installed.
This commit is contained in:
Bruno Tavares 2014-03-03 11:00:39 -03:00
parent 14c2e2aa83
commit 8216d790fa

View File

@ -7,8 +7,17 @@ kickstart.package.manager() {
kickstart.package.installed() { kickstart.package.installed() {
local pkg_manager=`kickstart.package.manager` local pkg_manager=`kickstart.package.manager`
[ $pkg_manager = 'apt-get' ] && dpkg -s "$@" >/dev/null 2>&1 && return $?
[ $pkg_manager = 'brew' ] && ! $(brew info "$@" | kickstart.stream.contains "Not installed") && return $? if [ $pkg_manager = 'apt-get' ]; then
dpkg -s "$@" >/dev/null 2>&1
return $?
fi
if [ $pkg_manager = 'brew' ]; then
! $(brew info "$@" | kickstart.stream.contains "Not installed")
return $?
fi
if [ $pkg_manager = 'yum' ]; then if [ $pkg_manager = 'yum' ]; then
local yum_packages="`yum list installed`" local yum_packages="`yum list installed`"
for package in "$@"; do for package in "$@"; do