From c779e16fe23c6e3bf340ecde633bae4972893058 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 2 Nov 2012 17:18:57 +0100 Subject: [PATCH] __rvm: use shortcut version Signed-off-by: Nico Schottelius --- cdist/conf/type/__rvm/gencode-remote | 23 ++++++++++++----------- docs/changelog | 1 + 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cdist/conf/type/__rvm/gencode-remote b/cdist/conf/type/__rvm/gencode-remote index aa6ef647..dbc6ba60 100755 --- a/cdist/conf/type/__rvm/gencode-remote +++ b/cdist/conf/type/__rvm/gencode-remote @@ -1,6 +1,7 @@ #!/bin/sh # # 2012 Evax Software +# 2012 Nico Schottelius (nico-cdist at schottelius.org) # # This file is part of cdist. # @@ -21,20 +22,20 @@ user="$__object_id" state_is="$(cat "$__object/explorer/state")" state_should="$(cat "$__object/parameter/state")" -if [ "$state_is" != "$state_should" ]; then - case "$state_should" in - present) - cat << DONE + +[ "$state_is" = "$state_should" ] && exit 0 + +case "$state_should" in + present) + cat << DONE su - $user -c "unset rvm_path; unset rvm_bin_path; unset rvm_prefix; unset rvm_version; curl -L get.rvm.io | bash -s stable" DONE - ;; - absent) - cat << DONE + ;; + absent) + cat << DONE su - $user -c "rm -Rf \"\\\$HOME/.rvm\"; sed '/rvm\/scripts\/rvm/d' \"\\\$HOME/.bashrc\" > \"\\\$HOME/.bashrc.cdist-tmp\" mv \"\\\$HOME/.bashrc.cdist-tmp\" \"\\\$HOME/.bashrc\"" - DONE - ;; - esac -fi + ;; +esac diff --git a/docs/changelog b/docs/changelog index a2c78210..e9423925 100644 --- a/docs/changelog +++ b/docs/changelog @@ -9,6 +9,7 @@ Changelog * Core: Export PYTHONPATH, it's also needed by emulator * Bugfix Type __rvm_ruby: Add clean package dependencies * Bugfix Type __rvm_gem: Run rvm as user, not as root + * Cleanup Type __rvm: Use shortcut version 2.1.0pre5: 2012-11-01 * Core: First round of tests updated to work with multiple configuration directories