diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-12-13 00:39:09 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2020-12-13 01:38:25 (EST) |
commit | 9e7b3e06d8042e46e2b7026223c674bc1225bf39 (patch) | |
tree | fd098290320ef598b20227e8aa9537548af23538 | |
parent | 49eff1e1b186a185e069a04c9af0da6be7a26708 (diff) |
build: Can't use "#" in target commands
Fixes:
/bin/sh: syntax error: unterminated quoted string
make: *** [../build:55: install] Error 2
-rwxr-xr-x | build | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -11,13 +11,20 @@ config_enabled = \ for cfg in $$(printf '%s' "$${1}"); do \ unset IFS; \ [ x"$${cfg}" = x'' ] && continue; \ - if [ x"$${cfg#!}" = x"$${cfg}" ]; then \ - grep -q "^CONFIG_$${cfg}=y$$" <src/.config \ - && enabled=true; \ - else \ - grep -q "^CONFIG_$${cfg#!}=y$$" <src/.config \ - && enabled=false; \ - fi; \ + case "$${cfg}" in \ + !*) \ + cfg="$$(printf '%s' "$${cfg}" | \ + sed 's/^!//')"; \ + grep -q "^CONFIG_$${cfg}=y$$" \ + <src/.config \ + && enabled=false; \ + ;; \ + *) \ + grep -q "^CONFIG_$${cfg}=y$$" \ + <src/.config \ + && enabled=true; \ + ;; \ + esac; \ done; \ unset IFS; \ $${enabled}; \ |