warn about deprecated usage

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-02-09 10:25:05 +01:00
parent 8e5a0f83c5
commit 52849b91c5

View file

@ -31,11 +31,19 @@ state_should="$(cat "$__object/parameter/state")"
# Correct pre 2.1 naming - FIXME in 2.1 # Correct pre 2.1 naming - FIXME in 2.1
case "$state_should" in case "$state_should" in
installed) state_should="present" ;; # FIXME: print warning to stderr!
removed) state_should="absent" ;; installed)
echo "WARNING: $state_should is deprecated, please change to present/absent (will be removed in cdist 2.1)" >&2
state_should="present"
;;
removed)
echo "WARNING: $state_should is deprecated, please change to present/absent (will be removed in cdist 2.1)" >&2
state_should="absent"
;;
esac esac
state_is="$(cat "$__object/explorer/pkg_status")" # FIXME: use grep directly, state is a list, not a line!
state_is="$(cat "$__object/explorer/state")"
case "$state_is" in case "$state_is" in
present*) present*)
name="$(echo "$state_is" | cut -d ' ' -f 2)" name="$(echo "$state_is" | cut -d ' ' -f 2)"