DRY: Remove default parameter value handeling in __package_pkg_freebsd

flavor, pkgsite and version are expected to be empty.
They're all checked with [ -n "$var" ]
This commit is contained in:
Antoine Catton 2014-12-27 20:42:03 -07:00
parent 9fd285da4c
commit f7bf6a058e
5 changed files with 5 additions and 17 deletions

View file

@ -51,23 +51,10 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/flavor" ]; then
flavor="$(cat "$__object/parameter/flavor")"
fi
if [ -f "$__object/parameter/version" ]; then
version="$(cat "$__object/parameter/version")"
fi
if [ -f "$__object/parameter/pkgsite" ]; then
pkgsite="$(cat "$__object/parameter/pkgsite")"
fi
if [ -f "$__object/parameter/state" ]; then
state="$(cat "$__object/parameter/state")"
else
state="present"
fi
flavor="$(cat "$__object/parameter/flavor")"
version="$(cat "$__object/parameter/version")"
pkgsite="$(cat "$__object/parameter/pkgsite")"
state="$(cat "$__object/parameter/state")"
curr_version="$(cat "$__object/explorer/pkg_version")"
add_cmd="pkg_add"
rm_cmd="pkg_delete"

View file

@ -0,0 +1 @@
present