qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] configure: Don't use bash-specific string-replacement sy


From: Thomas Huth
Subject: Re: [PATCH 3/5] configure: Don't use bash-specific string-replacement syntax
Date: Wed, 20 Jul 2022 17:57:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 20/07/2022 17.26, Peter Maydell wrote:
The variable string-replacement syntax ${var/old/new} is a bashism
(though it is also supported by some other shells), and for instance
does not work with the NetBSD /bin/sh, which complains:
  ../src/configure: 687: Syntax error: Bad substitution

Replace it with a more portable sed-based approach, similar to
what we already do in quote_sh().

Note that shellcheck also diagnoses this:

In ./configure line 687:
     e=${e/'\'/'\\'}
       ^-----------^ SC2039: In POSIX sh, string replacement is undefined.
            ^-- SC1003: Want to escape a single quote? echo 'This is how 
it'\''s done'.
                 ^-- SC1003: Want to escape a single quote? echo 'This is how 
it'\''s done'.


In ./configure line 688:
     e=${e/\"/'\"'}
       ^----------^ SC2039: In POSIX sh, string replacement is undefined.

Fixes: 8154f5e64b0cf ("meson: Prefix each element of firmware path")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  configure | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)

Thanks, this fixes "make vm-build-netbsd" for me!

Tested-by: Thomas Huth <thuth@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]