All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: alex.bennee@linaro.org, marcandre.lureau@redhat.com,
	berrange@redhat.com, stefanha@redhat.com
Subject: [PATCH 7/8] configure: quote command line arguments in config.status
Date: Thu,  7 Jan 2021 15:00:38 +0100	[thread overview]
Message-ID: <20210107140039.467969-8-pbonzini@redhat.com> (raw)
In-Reply-To: <20210107140039.467969-1-pbonzini@redhat.com>

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,.*,'&',"
+}
+
 print_error() {
     (echo
     echo "ERROR: $1"
@@ -6509,7 +6513,7 @@ preserve_env WINDRES
 
 printf "exec" >>config.status
 for i in "$0" "$@"; do
-  test "$i" = --skip-meson || printf " '%s'" "$i" >>config.status
+  test "$i" = --skip-meson || printf " %s" "$(quote_sh "$i")" >>config.status
 done
 echo ' "$@"' >>config.status
 chmod +x config.status
-- 
2.29.2




  parent reply	other threads:[~2021-01-07 14:08 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 ` Paolo Bonzini [this message]
2021-01-13 15:44   ` [PATCH 7/8] configure: quote command line arguments in config.status Eric Blake
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=20210107140039.467969-8-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=marcandre.lureau@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.