All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
@ 2015-12-14 15:02 Peter Maydell
  2015-12-14 15:13 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Peter Maydell @ 2015-12-14 15:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Unfortunately the OpenBSD pdksh does not like brackets inside
the right part of a ${variable+word} parameter expansion:

  $ echo "${a+($b)}"
  ksh: ${a+($b)}": bad substitution

though both bash and dash accept them. In any case this line
was causing odd output in the case where nettle is not present:
  nettle    no ()

(because if nettle is not present then $nettle will be "no",
not a null string or unset).

Rewrite it to just use an if.

This bug was originally introduced in becaeb726 and was present
in the 2.4.0 release.

Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
Reported-by: Dmitrij D. Czarkoff
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This fixes a problem where configure just falls over on OpenBSD,
but on the other hand it is not a regression since 2.4.0...
Opinions on whether we should put it in 2.5 as a last minute
thing welcome.

 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index b9552fd..6ca6c64 100755
--- a/configure
+++ b/configure
@@ -4758,7 +4758,11 @@ echo "GTK GL support    $gtk_gl"
 echo "GNUTLS support    $gnutls"
 echo "GNUTLS hash       $gnutls_hash"
 echo "libgcrypt         $gcrypt"
-echo "nettle            $nettle ${nettle+($nettle_version)}"
+if test "$nettle" = "yes"; then
+    echo "nettle            $nettle ($nettle_version)"
+else
+    echo "nettle            $nettle"
+fi
 echo "libtasn1          $tasn1"
 echo "VTE support       $vte"
 echo "curses support    $curses"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 15:02 [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh Peter Maydell
@ 2015-12-14 15:13 ` Eric Blake
  2015-12-14 17:28   ` Peter Maydell
  2015-12-14 16:04 ` Paolo Bonzini
  2015-12-18 15:07 ` Peter Maydell
  2 siblings, 1 reply; 7+ messages in thread
From: Eric Blake @ 2015-12-14 15:13 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches

[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]

On 12/14/2015 08:02 AM, Peter Maydell wrote:
> Unfortunately the OpenBSD pdksh does not like brackets inside
> the right part of a ${variable+word} parameter expansion:
> 
>   $ echo "${a+($b)}"
>   ksh: ${a+($b)}": bad substitution
> 
> though both bash and dash accept them. In any case this line
> was causing odd output in the case where nettle is not present:
>   nettle    no ()
> 
> (because if nettle is not present then $nettle will be "no",
> not a null string or unset).
> 
> Rewrite it to just use an if.
> 
> This bug was originally introduced in becaeb726 and was present
> in the 2.4.0 release.
> 
> Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
> Reported-by: Dmitrij D. Czarkoff
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This fixes a problem where configure just falls over on OpenBSD,
> but on the other hand it is not a regression since 2.4.0...
> Opinions on whether we should put it in 2.5 as a last minute
> thing welcome.

Can OpenBSD users do:

/path/to/bash ./configure

to work around it?

That, and the fact that we went an entire release cycle without a report
of a problem, means few developers are even attempting OpenBSD builds.
So, I would argue that as a non-regression, and where there is a likely
workaround of using a different shell, this can wait until 2.6.

> 
>  configure | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index b9552fd..6ca6c64 100755
> --- a/configure
> +++ b/configure
> @@ -4758,7 +4758,11 @@ echo "GTK GL support    $gtk_gl"
>  echo "GNUTLS support    $gnutls"
>  echo "GNUTLS hash       $gnutls_hash"
>  echo "libgcrypt         $gcrypt"
> -echo "nettle            $nettle ${nettle+($nettle_version)}"
> +if test "$nettle" = "yes"; then
> +    echo "nettle            $nettle ($nettle_version)"
> +else
> +    echo "nettle            $nettle"
> +fi

At any rate,
Reviewed-by: Eric Blake <eblake@redhat.com>

>  echo "libtasn1          $tasn1"
>  echo "VTE support       $vte"
>  echo "curses support    $curses"
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 15:02 [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh Peter Maydell
  2015-12-14 15:13 ` Eric Blake
@ 2015-12-14 16:04 ` Paolo Bonzini
  2015-12-18 15:07 ` Peter Maydell
  2 siblings, 0 replies; 7+ messages in thread
From: Paolo Bonzini @ 2015-12-14 16:04 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: patches



On 14/12/2015 16:02, Peter Maydell wrote:
> Unfortunately the OpenBSD pdksh does not like brackets inside
> the right part of a ${variable+word} parameter expansion:
> 
>   $ echo "${a+($b)}"
>   ksh: ${a+($b)}": bad substitution
> 
> though both bash and dash accept them. In any case this line
> was causing odd output in the case where nettle is not present:
>   nettle    no ()
> 
> (because if nettle is not present then $nettle will be "no",
> not a null string or unset).
> 
> Rewrite it to just use an if.
> 
> This bug was originally introduced in becaeb726 and was present
> in the 2.4.0 release.
> 
> Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
> Reported-by: Dmitrij D. Czarkoff
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This fixes a problem where configure just falls over on OpenBSD,
> but on the other hand it is not a regression since 2.4.0...
> Opinions on whether we should put it in 2.5 as a last minute
> thing welcome.

Harmless enough that it shouldn't warrant an extra rc.

Paolo

>  configure | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index b9552fd..6ca6c64 100755
> --- a/configure
> +++ b/configure
> @@ -4758,7 +4758,11 @@ echo "GTK GL support    $gtk_gl"
>  echo "GNUTLS support    $gnutls"
>  echo "GNUTLS hash       $gnutls_hash"
>  echo "libgcrypt         $gcrypt"
> -echo "nettle            $nettle ${nettle+($nettle_version)}"
> +if test "$nettle" = "yes"; then
> +    echo "nettle            $nettle ($nettle_version)"
> +else
> +    echo "nettle            $nettle"
> +fi
>  echo "libtasn1          $tasn1"
>  echo "VTE support       $vte"
>  echo "curses support    $curses"
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 15:13 ` Eric Blake
@ 2015-12-14 17:28   ` Peter Maydell
  2015-12-14 19:31     ` Markus Armbruster
  0 siblings, 1 reply; 7+ messages in thread
From: Peter Maydell @ 2015-12-14 17:28 UTC (permalink / raw)
  To: Eric Blake; +Cc: QEMU Developers, Patch Tracking

On 14 December 2015 at 15:13, Eric Blake <eblake@redhat.com> wrote:
> On 12/14/2015 08:02 AM, Peter Maydell wrote:
>> This fixes a problem where configure just falls over on OpenBSD,
>> but on the other hand it is not a regression since 2.4.0...
>> Opinions on whether we should put it in 2.5 as a last minute
>> thing welcome.
>
> Can OpenBSD users do:
>
> /path/to/bash ./configure
>
> to work around it?
>
> That, and the fact that we went an entire release cycle without a report
> of a problem, means few developers are even attempting OpenBSD builds.
> So, I would argue that as a non-regression, and where there is a likely
> workaround of using a different shell, this can wait until 2.6.

Mmm, I'm kind of leaning towards "don't put this in 2.5" as well.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 17:28   ` Peter Maydell
@ 2015-12-14 19:31     ` Markus Armbruster
  2015-12-14 20:30       ` Stefan Weil
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Armbruster @ 2015-12-14 19:31 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Patch Tracking

Peter Maydell <peter.maydell@linaro.org> writes:

> On 14 December 2015 at 15:13, Eric Blake <eblake@redhat.com> wrote:
>> On 12/14/2015 08:02 AM, Peter Maydell wrote:
>>> This fixes a problem where configure just falls over on OpenBSD,
>>> but on the other hand it is not a regression since 2.4.0...
>>> Opinions on whether we should put it in 2.5 as a last minute
>>> thing welcome.
>>
>> Can OpenBSD users do:
>>
>> /path/to/bash ./configure
>>
>> to work around it?
>>
>> That, and the fact that we went an entire release cycle without a report
>> of a problem, means few developers are even attempting OpenBSD builds.
>> So, I would argue that as a non-regression, and where there is a likely
>> workaround of using a different shell, this can wait until 2.6.
>
> Mmm, I'm kind of leaning towards "don't put this in 2.5" as well.

Add to http://qemu-project.org/ChangeLog/2.5#Known_issues and call it a
day?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 19:31     ` Markus Armbruster
@ 2015-12-14 20:30       ` Stefan Weil
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Weil @ 2015-12-14 20:30 UTC (permalink / raw)
  To: Markus Armbruster, Peter Maydell; +Cc: QEMU Developers, Patch Tracking

Am 14.12.2015 um 20:31 schrieb Markus Armbruster:
> Peter Maydell <peter.maydell@linaro.org> writes:
>
> Mmm, I'm kind of leaning towards "don't put this in 2.5" as well.
> Add to http://qemu-project.org/ChangeLog/2.5#Known_issues and call it a
> day?


Good idea. Done.

Regards,
Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh
  2015-12-14 15:02 [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh Peter Maydell
  2015-12-14 15:13 ` Eric Blake
  2015-12-14 16:04 ` Paolo Bonzini
@ 2015-12-18 15:07 ` Peter Maydell
  2 siblings, 0 replies; 7+ messages in thread
From: Peter Maydell @ 2015-12-18 15:07 UTC (permalink / raw)
  To: QEMU Developers; +Cc: qemu-stable, Patch Tracking

On 14 December 2015 at 15:02, Peter Maydell <peter.maydell@linaro.org> wrote:
> Unfortunately the OpenBSD pdksh does not like brackets inside
> the right part of a ${variable+word} parameter expansion:
>
>   $ echo "${a+($b)}"
>   ksh: ${a+($b)}": bad substitution
>
> though both bash and dash accept them. In any case this line
> was causing odd output in the case where nettle is not present:
>   nettle    no ()
>
> (because if nettle is not present then $nettle will be "no",
> not a null string or unset).
>
> Rewrite it to just use an if.
>
> This bug was originally introduced in becaeb726 and was present
> in the 2.4.0 release.
>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
> Reported-by: Dmitrij D. Czarkoff
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This fixes a problem where configure just falls over on OpenBSD,
> but on the other hand it is not a regression since 2.4.0...
> Opinions on whether we should put it in 2.5 as a last minute
> thing welcome.

Now committed to master since we're post-2.5. I added a
Cc: qemu-stable@nongnu.org

too.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-18 15:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 15:02 [Qemu-devel] [PATCH for-2.5??] configure: Fix shell syntax to placate OpenBSD's pdksh Peter Maydell
2015-12-14 15:13 ` Eric Blake
2015-12-14 17:28   ` Peter Maydell
2015-12-14 19:31     ` Markus Armbruster
2015-12-14 20:30       ` Stefan Weil
2015-12-14 16:04 ` Paolo Bonzini
2015-12-18 15:07 ` Peter Maydell

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.