Merge branch 'master' of git://git.schottelius.org/cdist

This commit is contained in:
Andreas Brönnimann 2011-04-05 19:52:16 +02:00
commit 23c35acf16
12 changed files with 49 additions and 23 deletions

View file

@ -17,7 +17,7 @@ It dispatches the actual work to the package system dependant types.
REQUIRED PARAMETERS
-------------------
state::
The state the package should be in, either "installed" or "uninstalled"
The state the package should be in, either "installed" or "removed"
OPTIONAL PARAMETERS

View file

@ -46,10 +46,14 @@ case "$state" in
echo $aptget install \"$name\"
fi
;;
uninstalled)
removed)
# Remove only if existent
if [ -n "$is_installed" ]; then
echo $aptget remove \"$name\"
fi
;;
*)
echo "Unknown state: $state" >&2
exit 1
;;
esac

View file

@ -17,7 +17,7 @@ manage packages.
REQUIRED PARAMETERS
-------------------
state::
Either "installed" or "deinstalled".
Either "installed" or "removed".
OPTIONAL PARAMETERS
@ -37,7 +37,7 @@ __package_apt zsh --state installed
__package_apt webserver --state installed --name nginx
# Remove obsolete package
__package_apt puppet --state deinstalled
__package_apt puppet --state removed
--------------------------------------------------------------------------------

View file

@ -44,9 +44,13 @@ case "$state" in
echo pacman "$pacopts" -S \"$name\"
fi
;;
uninstalled)
removed)
if [ "$pkg_version" ]; then
echo pacman "$pacopts" -R \"$name\"
fi
;;
*)
echo "Unknown state: $state" >&2
exit 1
;;
esac

View file

@ -17,7 +17,7 @@ packages.
REQUIRED PARAMETERS
-------------------
state::
Either "installed" or "deinstalled".
Either "installed" or "removed".
OPTIONAL PARAMETERS
@ -37,7 +37,7 @@ __package_pacman zsh --state installed
__package_pacman python --state installed --name python2
# Remove obsolete package
__package_pacman puppet --state deinstalled
__package_pacman puppet --state removed
--------------------------------------------------------------------------------

View file

@ -39,9 +39,13 @@ case "$state" in
echo yum $opts install \"$name\"
fi
;;
uninstalled)
removed)
if ! grep -q "$not_installed" "$__object/explorer/pkg_version"; then
echo yum $opts remove \"$name\"
fi
;;
*)
echo "Unknown state: $state" >&2
exit 1
;;
esac

View file

@ -18,7 +18,7 @@ slightly confusing error message "Error: Nothing to do".
REQUIRED PARAMETERS
-------------------
state::
Either "installed" or "deinstalled".
Either "installed" or "removed".
OPTIONAL PARAMETERS
@ -38,7 +38,7 @@ __package_yum zsh --state installed
__package_yum python --state installed --name python2
# Remove obsolete package
__package_yum puppet --state deinstalled
__package_yum puppet --state removed
--------------------------------------------------------------------------------