cleanup of gencode-remote

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-04-02 02:19:30 +02:00
parent 981df12e9a
commit bcc7d0e795

View file

@ -18,15 +18,9 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
#
# Manage packages with Pacman (mostly archlinux)
# Manage packages with yum (mostly Fedora)
#
# Debug
# exec >&2
# set -x
pacopts="--noconfirm --noprogressbar"
if [ -f "$__object/parameter/name" ]; then
name="$__object/parameter/name"
else
@ -34,19 +28,17 @@ else
fi
state="$(cat "$__object/parameter/state")"
pkg_version="$(cat "$__object/explorer/pkg_version")"
opts="--assumeyes --quiet"
case "$state" in
installed)
# Empty? Not installed.
if [ -z "$pkg_version" ]; then
echo pacman "$pacopts" -S \"$name\"
if grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
echo yum $opts install \"$name\"
fi
;;
uninstalled)
if [ "$pkg_version" ]; then
echo pacman "$pacopts" -R \"$name\"
if ! grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
echo yum $opts remove \"$name\"
fi
;;
esac