Pass classes as separate arguments to template_default
To work around problem with passing newlines in variable with awk on darwin. This fixes #437.
This commit is contained in:
parent
d74a41b1b4
commit
8e5d4b1578
1 changed files with 5 additions and 2 deletions
7
yadm
7
yadm
|
@ -369,6 +369,10 @@ function template_default() {
|
|||
# all versions of awk seem to support the POSIX character classes [[:blank:]]
|
||||
read -r -d '' awk_pgm << "EOF"
|
||||
BEGIN {
|
||||
classes = ARGV[2]
|
||||
for (i = 3; i < ARGC; ++i) {
|
||||
classes = classes "\n" ARGV[i]
|
||||
}
|
||||
yadm["class"] = class
|
||||
yadm["classes"] = classes
|
||||
yadm["arch"] = arch
|
||||
|
@ -485,9 +489,8 @@ EOF
|
|||
-v distro_family="$local_distro_family" \
|
||||
-v source="$input" \
|
||||
-v source_dir="$(dirname "$input")" \
|
||||
-v classes="$(join_string $'\n' "${local_classes[@]}")" \
|
||||
"$awk_pgm" \
|
||||
"$input" > "$temp_file" || rm -f "$temp_file"
|
||||
"$input" "${local_classes[@]}" > "$temp_file" || rm -f "$temp_file"
|
||||
|
||||
move_file "$input" "$output" "$temp_file"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue