From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, alex.bennee@linaro.org,
berrange@redhat.com, stefanha@redhat.com
Subject: Re: [PATCH 7/8] configure: quote command line arguments in config.status
Date: Wed, 13 Jan 2021 09:44:55 -0600 [thread overview]
Message-ID: <e74351a2-3609-53ef-c2c6-efea6be4cc75@redhat.com> (raw)
In-Reply-To: <20210107140039.467969-8-pbonzini@redhat.com>
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
next prev parent reply other threads:[~2021-01-13 15:48 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 14:00 [RFC PATCH v2 0/8] Automatically convert configure options to meson build options Paolo Bonzini
2021-01-07 14:00 ` [PATCH 1/8] build-system: clean up TCG/TCI configury Paolo Bonzini
2021-01-07 15:01 ` Peter Maydell
2021-01-07 15:50 ` Paolo Bonzini
2021-01-07 16:06 ` Daniel P. Berrangé
2021-01-13 13:09 ` Philippe Mathieu-Daudé
2021-01-13 13:42 ` Helge Deller
2021-01-13 13:57 ` Daniel P. Berrangé
2021-01-13 14:23 ` Peter Maydell
2021-01-13 20:39 ` Helge Deller
2021-01-13 14:23 ` Helge Deller
2021-01-13 14:34 ` Paolo Bonzini
2021-01-13 15:37 ` Helge Deller
2021-01-14 9:51 ` John Paul Adrian Glaubitz
2021-01-13 14:02 ` John David Anglin
2021-01-13 15:00 ` John Paul Adrian Glaubitz
2021-01-07 14:00 ` [PATCH 2/8] cocoa: do not enable coreaudio automatically Paolo Bonzini
2021-01-07 14:00 ` [PATCH 3/8] gtk: remove CONFIG_GTK_GL Paolo Bonzini
2021-01-07 16:05 ` Gerd Hoffmann
2021-01-07 14:00 ` [PATCH 4/8] configure: move X11 detection to Meson Paolo Bonzini
2021-01-07 14:00 ` [PATCH 5/8] configure: move GTK+ " Paolo Bonzini
2021-01-07 14:00 ` [PATCH 6/8] configure: move Cocoa incompatibility checks " Paolo Bonzini
2021-01-07 14:00 ` [PATCH 7/8] configure: quote command line arguments in config.status Paolo Bonzini
2021-01-13 15:44 ` Eric Blake [this message]
2021-01-07 14:00 ` [PATCH 8/8] configure: automatically parse command line for meson -D options Paolo Bonzini
2021-01-13 10:31 ` Daniel P. Berrangé
2021-01-13 12:26 ` Paolo Bonzini
2021-01-13 14:04 ` Paolo Bonzini
2021-01-22 8:00 ` 罗勇刚(Yonggang Luo)
2021-01-22 20:43 ` Paolo Bonzini
2021-01-23 3:30 ` 罗勇刚(Yonggang Luo)
2021-01-23 18:00 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e74351a2-3609-53ef-c2c6-efea6be4cc75@redhat.com \
--to=eblake@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).