update to work with new variables

Signed-off-by: Steven Armstrong <steven.armstrong@inf.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-03-03 08:33:14 +01:00
parent 4c447b59ac
commit fe5e0c7541
4 changed files with 19 additions and 18 deletions

View file

@ -1,7 +0,0 @@
install/pacman:
pacman --noconfirm --noprogressbar -S
--------------------------------------------------------------------------------
ensure: What state the package should be in: present | absent | latest | versionstring (1.0.3)
name: The package name as used by the packaging system

View file

@ -23,21 +23,28 @@
# system.
#
. cdist-config
object_id="$1"; shift
if [ -f type ]; then
type="$(cat type)"
type="$__object/parameter/type"
if [ -f "$type" ]; then
type="$(cat "$type")"
else
# Default to value taken from explorer
type="$(cat $__cdist_out_explorers/pkg_system)"
# By default determine package manager based on operating system
os="$(cat "out/explorer/os")"
case "$os" in
archlinux) type="pacman" ;;
debian|ubuntu) type="apt" ;;
gentoo) type="emerge" ;;
*)
echo "Don't know how to manage packages on: $os" >&2
exit 1
;;
esac
fi
set -- "$@" "$object_id"
set -- "$@" "$__object_id"
cd "$__object/parameter"
for property in $(ls .); do
if [ "$property" != "type" ]; then
set -- "$@" "--$property" "$(cat $property)"
set -- "$@" "--$property" "$(cat "$property")"
fi
done

View file

@ -1,2 +1,3 @@
name
version
type

View file

@ -1 +1 @@
ensure
state