diff options
Diffstat (limited to 'scripts/lib/ptxd_make_import.awk')
-rwxr-xr-x | scripts/lib/ptxd_make_import.awk | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/lib/ptxd_make_import.awk b/scripts/lib/ptxd_make_import.awk index 40c5c877f..8a457478d 100755 --- a/scripts/lib/ptxd_make_import.awk +++ b/scripts/lib/ptxd_make_import.awk @@ -48,10 +48,7 @@ FNR == 1 { out_file = importdir "/" prefix_file "/" gensub(in_path "/", "", "g", FILENAME); out_dir = gensub(/^(.*)\/.*/, "\\1", "g", out_file); - err = system(" \ - if [ \\! -d \"" out_dir "\" ]; then \ - mkdir -p -- \"" out_dir "\"; \ - fi"); + err = system("mkdir -p -- \"" out_dir "\""); if (err != 0) exit(err); } @@ -104,14 +101,19 @@ FNR == 1 { # add prefix to symbols on line # function add_prefix(IN, in_match) { -# depends on FOO && BAR -# +--------+ +-------+ -# | | -# in_match[1] | -# | -# in_match[4] - - match(IN, /^([[:space:]]*(config|select|default|if|depends([[:space:]]+on)?)[[:space:]]+)(.*)$/, in_match); +# depends on FOO && BAR +# +----------------+ +--------+ +# | | +# in_match[1] | +# | +# in_match[4] + + match(IN, /^([[:space:]]*(config|select|default|if|depends([[:space:]]+on)?)[[:space:]]+)((")?[^"]*(")?)$/, in_match); + + # don't convert things wrapped in "" + if (in_match[5] ~ /"/) { + return $0; + } # don't convert "N" symbols like in "default N" return in_match[1] gensub(/(!)?(N[A-Z0-9_]+|[A-MO-Z]+[A-Z0-9_]*)/, "\\1" prefix "\\2", "g", in_match[4]); |