work around a bug in bash3, now tested with dash, bash, busybox

This commit is contained in:
Daniel Heule 2014-02-27 17:04:23 +01:00
parent 0198b99eb5
commit 727c918f67
1 changed files with 11 additions and 14 deletions

View File

@ -80,30 +80,27 @@ case "$state_should" in
esac
cat <<__CDIST_HEREDOC_END_HERE_MARKER
export state="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
IFS='\n' read -r state <<'__CDIST_INPUT_END_HERE_MARKER'
$state_should
__CDIST_INPUT_END_HERE_MARKER
)"
export key="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
export state
IFS='\n' read -r key <<'__CDIST_INPUT_END_HERE_MARKER'
$key
__CDIST_INPUT_END_HERE_MARKER
)"
export value="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
export key
IFS='\n' read -r value <<'__CDIST_INPUT_END_HERE_MARKER'
$(cat "$__object/parameter/value")
__CDIST_INPUT_END_HERE_MARKER
)"
export delimiter="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
export value
IFS='\n' read -r delimiter <<'__CDIST_INPUT_END_HERE_MARKER'
$(cat "$__object/parameter/delimiter")
__CDIST_INPUT_END_HERE_MARKER
)"
export exact_delimiter="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
$exact_delimiter
__CDIST_INPUT_END_HERE_MARKER
)"
export comment="\$(cat <<"__CDIST_INPUT_END_HERE_MARKER"
export delimiter
IFS='\n' read -r comment <<'__CDIST_INPUT_END_HERE_MARKER'
$(cat "$__object/parameter/comment")
__CDIST_INPUT_END_HERE_MARKER
)"
export comment
export exact_delimiter="$exact_delimiter"
tmpfile=\$(mktemp "${file}.cdist.XXXXXXXXXX")
# preserve ownership and permissions by copying existing file over tmpfile