meson: Prefix each element of firmware path

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20220624154042.51512-1-akihiko.odaki@gmail.com>
[Rewrite shell function without using Bash extensions. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Akihiko Odaki 2022-06-25 00:40:42 +09:00 committed by Paolo Bonzini
parent 98753e9a8f
commit 8154f5e64b
6 changed files with 37 additions and 10 deletions

View file

@ -156,7 +156,7 @@ def cli_metavar(opt):
if opt["type"] == "string":
return "VALUE"
if opt["type"] == "array":
return "CHOICES"
return "CHOICES" if "choices" in opt else "VALUES"
return "CHOICE"
@ -199,7 +199,10 @@ def print_parse(options):
key = cli_option(opt)
name = opt["name"]
if require_arg(opt):
print(f' --{key}=*) quote_sh "-D{name}=$2" ;;')
if opt["type"] == "array" and not "choices" in opt:
print(f' --{key}=*) quote_sh "-D{name}=$(meson_option_build_array $2)" ;;')
else:
print(f' --{key}=*) quote_sh "-D{name}=$2" ;;')
elif opt["type"] == "boolean":
print(f' --enable-{key}) printf "%s" -D{name}=true ;;')
print(f' --disable-{key}) printf "%s" -D{name}=false ;;')