qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Darren Kenny <darren.kenny@oracle.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Alexander Bulekov <alxndr@bu.edu>,
	qemu-devel@nongnu.org
Cc: Bandan Das <bsd@redhat.com>, Thomas Huth <thuth@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Qiuhao Li <Qiuhao.Li@outlook.com>
Subject: Re: [PATCH] fuzz: fix unbound variable in build.sh
Date: Wed, 08 Sep 2021 11:43:37 +0100	[thread overview]
Message-ID: <m28s07gxeu.fsf@oracle.com> (raw)
In-Reply-To: <e93ce7f6-2f0c-f676-e1e7-b5a59376561b@redhat.com>

On Wednesday, 2021-09-08 at 08:06:27 +02, Paolo Bonzini wrote:
> On 07/09/21 13:08, Alexander Bulekov wrote:
>>   
>> -if [ "$GITLAB_CI" != "true" ]; then
>> +if [ -z ${GITLAB_CI+x} ]; then
>
> I would slightly prefer to have "${GITLAB_CI+x}", since "test" in 
> general doesn't like parameters that go away:
>
> $ [ = abc ]
> bash: [: =: unary operator expected
>
> What you wrote however works, so it's okay.
>

If we are certain that the script is running a bash variant then we
really should be using the '[[ ... ]]' variant of test which doesn't
have that limitation since it can handle an empty or unset variable
correctly.

This doesn't appear to be the assumption though.

Thanks,

Darren.



      reply	other threads:[~2021-09-08 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 11:08 [PATCH] fuzz: fix unbound variable in build.sh Alexander Bulekov
2021-09-07 11:43 ` Darren Kenny
2021-09-07 12:32 ` Thomas Huth
2021-09-07 12:51   ` Alexander Bulekov
2021-09-08  5:53     ` Thomas Huth
2021-09-08  6:06 ` Paolo Bonzini
2021-09-08 10:43   ` Darren Kenny [this message]

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=m28s07gxeu.fsf@oracle.com \
    --to=darren.kenny@oracle.com \
    --cc=Qiuhao.Li@outlook.com \
    --cc=alxndr@bu.edu \
    --cc=bsd@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@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).