From c70bfb2e207631c9137e5c8dc89cb2c45f0ff2ae Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 10 Aug 2011 15:55:55 +0200 Subject: [PATCH] cleanup for correct working in function environment Signed-off-by: Nico Schottelius --- core/__cdist_type_build_emulation | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/__cdist_type_build_emulation b/core/__cdist_type_build_emulation index a6cfcaa6..5457c99b 100755 --- a/core/__cdist_type_build_emulation +++ b/core/__cdist_type_build_emulation @@ -22,9 +22,8 @@ __cdist_type_build_emulation() { - [ $# -eq 1 ] || __cdist_usage "" + [ $# -eq 0 ] || __cdist_usage "No arguments" - __cdist_output_dir="$1"; shift __cdist_type_emulator="$__cdist_abs_mydir/cdist-type-emulator" if [ ! -d "${__cdist_type_dir}" ]; then @@ -32,12 +31,15 @@ __cdist_type_build_emulation() fi # Get Types - cd "${__cdist_type_dir}" - ls -1 > "${__cdist_tmp_file}" + ( + cd "${__cdist_type_dir}" + ls -1 > "${__cdist_tmp_file}" + ) # Create binaries - mkdir -p "${__cdist_output_dir}" - while read type; do - ln -sf "${__cdist_type_emulator}" "${__cdist_output_dir}/${type}" + mkdir -p "${__cdist_out_type_bin_dir}" + while read __cdist_type_build_emulation_type; do + ln -sf "${__cdist_type_emulator}" \ + "${__cdist_out_type_bin_dir}/${__cdist_type_build_emulation_type}" done < "${__cdist_tmp_file}" }