DRY: Remove default parameter value handeling in __package_pkgng_freebsd
flavor, repo and version are expected to be empty by default. They're all checked with [ -n "$var" ]
This commit is contained in:
parent
f7bf6a058e
commit
ebf0479f60
5 changed files with 5 additions and 16 deletions
|
@ -31,13 +31,8 @@ else
|
||||||
name="$__object_id"
|
name="$__object_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/flavor" ]; then
|
|
||||||
flavor="$(cat "$__object/parameter/flavor")"
|
flavor="$(cat "$__object/parameter/flavor")"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/version" ]; then
|
|
||||||
version="$(cat "$__object/parameter/version")"
|
version="$(cat "$__object/parameter/version")"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/upgrade" ]; then
|
if [ -f "$__object/parameter/upgrade" ]; then
|
||||||
upgrade="true"
|
upgrade="true"
|
||||||
|
@ -45,15 +40,8 @@ else
|
||||||
upgrade="false"
|
upgrade="false"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$__object/parameter/repo" ]; then
|
|
||||||
repo="$(cat "$__object/parameter/repo")"
|
repo="$(cat "$__object/parameter/repo")"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$__object/parameter/state" ]; then
|
|
||||||
state="$(cat "$__object/parameter/state")"
|
state="$(cat "$__object/parameter/state")"
|
||||||
else
|
|
||||||
state="present"
|
|
||||||
fi
|
|
||||||
curr_version="$(cat "$__object/explorer/pkg_version")"
|
curr_version="$(cat "$__object/explorer/pkg_version")"
|
||||||
add_cmd="pkg install -y"
|
add_cmd="pkg install -y"
|
||||||
rm_cmd="pkg delete -y"
|
rm_cmd="pkg delete -y"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
present
|
Loading…
Reference in a new issue