From 1785f5acd07388a1e04e6846e3bcb4b3826cd924 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 19 Mar 2011 23:12:49 +0100 Subject: [PATCH] add local/remote code run capability Signed-off-by: Nico Schottelius --- bin/cdist-code-run | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cdist-code-run b/bin/cdist-code-run index 009c0743..42b4901d 100755 --- a/bin/cdist-code-run +++ b/bin/cdist-code-run @@ -22,30 +22,30 @@ # . cdist-config -[ $# -eq 2 ] || __cdist_usage " " +[ $# -eq 3 ] || __cdist_usage " " set -ue # This variable MUST be exactly like this - see __cdist_object_dir __cdist_out_object_dir="$1"; shift object="$1"; shift +__cdist_gencode_type="$1"; shift if [ ! -d "$(__cdist_object_dir "$object")" ]; then __cdist_exit_err "Object $object is missing." fi - finished="$(__cdist_object_code_finished "$object")" -code="$(__cdist_object_code "$object")" require="$(__cdist_object_require "$object")" +code="$(__cdist_object_code "$object")-${__cdist_gencode_type}" # Do nothing if our work has been done if [ -f "$finished" ]; then exit 0 fi -echo "Checking code for $object ..." +echo "Checking code-${__cdist_gencode_type} for $object ..." if [ -f "$require" ]; then while read requirement; do @@ -57,7 +57,7 @@ fi if [ -e "$code" ]; then if [ -f "$code" ]; then if [ -x "$code" ]; then - echo "Executing code for $object ..." + echo "Executing code-${__cdist_gencode_type} for $object ..." "$code" touch "$finished" else