[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/8] configure: quote command line arguments in config.status
From: |
Eric Blake |
Subject: |
Re: [PATCH 7/8] configure: quote command line arguments in config.status |
Date: |
Wed, 13 Jan 2021 09:44:55 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 1/7/21 8:00 AM, Paolo Bonzini wrote:
> Make config.status generation a bit more robust. (The quote_sh
> function will also be reused to parse configure's command line
> arguments in an external script driven by Meson build option
> introspection).
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> configure | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index d573058b16..41866cc38e 100755
> --- a/configure
> +++ b/configure
> @@ -89,6 +89,10 @@ printf " '%s'" "$0" "$@" >> config.log
> echo >> config.log
> echo "#" >> config.log
>
> +quote_sh() {
> + printf "%s" "$1" | sed "s,','\\\\'',g; s,.*,'&',"
> +}
printf %s does not append a newline, but POSIX does not require sed to
behave sanely when its input does not end in a newline.
But unless we hit a case where someone is actually using a sed that
complains, this works for me.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [PATCH 3/8] gtk: remove CONFIG_GTK_GL, (continued)
- [PATCH 3/8] gtk: remove CONFIG_GTK_GL, Paolo Bonzini, 2021/01/07
- [PATCH 2/8] cocoa: do not enable coreaudio automatically, Paolo Bonzini, 2021/01/07
- [PATCH 5/8] configure: move GTK+ detection to Meson, Paolo Bonzini, 2021/01/07
- [PATCH 4/8] configure: move X11 detection to Meson, Paolo Bonzini, 2021/01/07
- [PATCH 8/8] configure: automatically parse command line for meson -D options, Paolo Bonzini, 2021/01/07
- [PATCH 7/8] configure: quote command line arguments in config.status, Paolo Bonzini, 2021/01/07
- Re: [PATCH 7/8] configure: quote command line arguments in config.status,
Eric Blake <=
- [PATCH 6/8] configure: move Cocoa incompatibility checks to Meson, Paolo Bonzini, 2021/01/07