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/>. # 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 if [ -f "$__object/parameter/name" ]; then
name="$__object/parameter/name" name="$__object/parameter/name"
else else
@ -34,19 +28,17 @@ else
fi fi
state="$(cat "$__object/parameter/state")" state="$(cat "$__object/parameter/state")"
pkg_version="$(cat "$__object/explorer/pkg_version")"
opts="--assumeyes --quiet"
case "$state" in case "$state" in
installed) installed)
if grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
# Empty? Not installed. echo yum $opts install \"$name\"
if [ -z "$pkg_version" ]; then
echo pacman "$pacopts" -S \"$name\"
fi fi
;; ;;
uninstalled) uninstalled)
if [ "$pkg_version" ]; then if ! grep -q "is not installed\$" "$__object/explorer/pkg_version"; then
echo pacman "$pacopts" -R \"$name\" echo yum $opts remove \"$name\"
fi fi
;; ;;
esac esac