From 5e34bebc052bc0f12c70a95f022fa43e30cc2240 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 28 Apr 2011 15:07:13 +0200 Subject: [PATCH] cleanup in cdist-object-gencode Signed-off-by: Nico Schottelius --- bin/cdist-object-gencode | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/cdist-object-gencode b/bin/cdist-object-gencode index 12c66026..e21568a3 100755 --- a/bin/cdist-object-gencode +++ b/bin/cdist-object-gencode @@ -30,21 +30,19 @@ __cdist_target_host="$1"; shift __cdist_object_self="$1"; shift __cdist_gencode_type="$1"; shift -__cdist_object_dir="$(__cdist_object_dir "$__cdist_object_self")" __cdist_type="$(__cdist_type_from_object "$__cdist_object_self")" -__cdist_object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" -__cdist_code_output="$(__cdist_object_code "$__cdist_object_self" "$__cdist_gencode_type")" __cdist_type_gencode="$(__cdist_type_gencode "$__cdist_type" "$__cdist_gencode_type")" +__cdist_code_output="$(__cdist_object_code "$__cdist_object_self" "$__cdist_gencode_type")" -# export variables for gencode -export __object_id="$__cdist_object_id" -export __object="$__cdist_object_dir" +# export variables for the gencode script +export __object_id="$(__cdist_object_id_from_object "$__cdist_object_self")" +export __object="$(__cdist_object_dir "$__cdist_object_self")" export __global="$__cdist_out_dir" if [ -x "$__cdist_type_gencode" ]; then - __cdist_exec_fail_on_error "$gencode" > "$__cdist_tmp_file" + __cdist_exec_fail_on_error "$__cdist_type_gencode" > "$__cdist_tmp_file" else - if [ -f "$__cdist_type_gencode" ]; then + if [ -e "$__cdist_type_gencode" ]; then __cdist_exit_err "$__cdist_type_gencode exists, but is not executable" fi