only install/deinstall apt packages if necessary

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-03-02 19:21:15 +01:00
parent c90ae945a8
commit 3a10475151

View file

@ -27,14 +27,18 @@ else
name="$__object_id" name="$__object_id"
fi fi
state=$(cat "$__object/parameter/state") state="$(cat "$__object/parameter/state")"
case "$state" in case "$state" in
installed) installed)
pkg_status="$(cat "$__object/explorer/pkg_status")"
if [ "$pkg_status" != "ii" ]; then
echo apt-get --quiet --yes install \"$name\" echo apt-get --quiet --yes install \"$name\"
fi
;; ;;
deinstalled) deinstalled)
if [ "$pkg_status" != "un" ]; then
echo apt-get --quiet --yes remove \"$name\" echo apt-get --quiet --yes remove \"$name\"
fi
;; ;;
esac esac