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
1 changed files with 8 additions and 4 deletions

View File

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