update __package_luarocks to new style state checking

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-02-16 23:18:26 +01:00
parent 76a3c20669
commit 9fab782a0c

View file

@ -49,18 +49,15 @@ else
state_is="absent" state_is="absent"
fi fi
case "$state" in # Leave if nothing is to be done
installed) [ "$state_is" = "$state_should" ] && exit 0
# Install only if non-existent
if [ -z "$is_installed" ]; then case "$state_should" in
present)
echo luarocks install \"$name\" echo luarocks install \"$name\"
fi
;; ;;
removed) absent)
# Remove only if existent
if [ -n "$is_installed" ]; then
echo luarocks remove \"$name\" echo luarocks remove \"$name\"
fi
;; ;;
*) *)
echo "Unknown state: $state" >&2 echo "Unknown state: $state" >&2