From ff50a61344f2382d53bb4ea0c926c3872ffb870f Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 10 Jul 2013 14:16:56 +0200 Subject: [PATCH] use shortcut version in __package_opkg Signed-off-by: Nico Schottelius --- cdist/conf/type/__package_opkg/gencode-remote | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/cdist/conf/type/__package_opkg/gencode-remote b/cdist/conf/type/__package_opkg/gencode-remote index 43f1ad8a..1fb78fbe 100755 --- a/cdist/conf/type/__package_opkg/gencode-remote +++ b/cdist/conf/type/__package_opkg/gencode-remote @@ -1,6 +1,6 @@ #!/bin/sh # -# 2011 Nico Schottelius (nico-cdist at schottelius.org) +# 2011,2013 Nico Schottelius (nico-cdist at schottelius.org) # 2012 Giel van Schijndel (giel plus cdist at mortis dot eu) # # This file is part of cdist. @@ -42,20 +42,20 @@ case "$state_is" in ;; esac -if [ "$state_is" != "$state_should" ]; then - case "$state_should" in - present) - if [ "$present" = "notpresent" ]; then +[ "$state_is" = "$state_should" ] && exit 0 + +case "$state_should" in + present) + if [ "$present" = "notpresent" ]; then echo opkg --verbosity=0 update - fi - echo opkg --verbosity=0 install \"$name\" - ;; - absent) - echo opkg --verbosity=0 remove \"$name\" - ;; - *) - echo "Unknown state: $state" >&2 - exit 1 - ;; - esac -fi + fi + echo opkg --verbosity=0 install \"$name\" + ;; + absent) + echo opkg --verbosity=0 remove \"$name\" + ;; + *) + echo "Unknown state: $state" >&2 + exit 1 + ;; +esac