Migrated to using present/absent for --state param.

This commit is contained in:
Jake Guffey 2012-02-20 10:51:18 -05:00
parent b7e3378262
commit 377afe8b1c
2 changed files with 4 additions and 4 deletions

View file

@ -90,7 +90,7 @@ execcmd(){
}
if [ -n "$curr_version" ]; then # PKG *is* installed
if [ "$state" = "removed" ]; then # Shouldn't be installed
if [ "$state" = "absent" ]; then # Shouldn't be installed
if [ -n "$flavor" ]; then
cmd="${rm_cmd} ${name}-${flavor}-${curr_version}"
else
@ -115,9 +115,9 @@ if [ -n "$curr_version" ]; then # PKG *is* installed
fi
fi
else # PKG *isn't* installed
if [ "$state" = "removed" ]; then # Shouldn't be installed
if [ "$state" = "absent" ]; then # Shouldn't be installed
exit 0
elif [ "$state" = "installed" ]; then # Is not currently installed, should be
elif [ "$state" = "present" ]; then # Is not currently installed, should be
if [ -n "$flavor" ]; then
cmd="${add_cmd} -r ${name}-${flavor}"
else

View file

@ -16,7 +16,7 @@ This type is usually used on FreeBSD to manage packages.
REQUIRED PARAMETERS
-------------------
state::
Either "installed" or "removed".
Either "present" or "absent".
OPTIONAL PARAMETERS