qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: "Andreas Färber" <andreas.faerber@web.de>,
	"Bug 636315" <636315@bugs.launchpad.net>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage
Date: Tue, 14 Sep 2010 16:41:05 +0000	[thread overview]
Message-ID: <AANLkTimSwbnUYQn_=q4wWZYiHxdyy-bu0Wknh3awmR_4@mail.gmail.com> (raw)
In-Reply-To: <4C8DE5AE.7040402@msgid.tls.msk.ru>

On Mon, Sep 13, 2010 at 8:49 AM, Michael Tokarev <mjt@tls.msk.ru> wrote:
> 13.09.2010 01:05, Blue Swirl wrote:
>> On Sun, Sep 12, 2010 at 5:58 PM, Andreas Färber <andreas.faerber@web.de> wrote:
>>> Am 12.09.2010 um 19:47 schrieb Blue Swirl:
>>>
>>>> On Sun, Sep 12, 2010 at 5:35 PM, Andreas Färber <andreas.faerber@web.de>
>>>> wrote:
>>>>>
>>>>> Am 12.09.2010 um 19:22 schrieb Blue Swirl:
>>>>>
>>>>>> What is the output of "sh ./tracetool --nop --check-backend"?
>>>>>
>>>>> ./tracetool: syntax error at line 51: `$' unexpected
>>>>
>>>> Does this patch fix the problem?
>>>>
>>>> diff --git a/tracetool b/tracetool
>>>> index 534cc70..c7582bf 100755
>>>> --- a/tracetool
>>>> +++ b/tracetool
>>>> @@ -48,7 +48,8 @@ get_argnames()
>>>> {
>>>>    local nfields field name
>>>>    nfields=0
>>>> -    for field in $(get_args "$1"); do
>>>> +    args=get_args "$1"
>>>> +    for field in "$args"; do
>>>
>>> This part yes. (I took the liberty of adding args to the local line above)
>
> Um.  Are you sure it works as expected?  I'm not at all shure.
> There are 2 errors in the above patch:
>
>  +    args=get_args "$1"
>
> After this line, variable $args will contain one word: "get_args".
> Shell will try to execute a command or call a shell function which
> name is stored in $1, if it is assigned.  If it is not, at least
> bash will complain that it can't execute command "".
>
> The proper way is to add backticks:
>
>  +    args=`get_args "$1"`
>
> In the second line:
>
>  +    for field in "$args"; do
>
> the double quotes ensure that all words in $args are
> processed as single word, all at once.  So the for loop
> will be executed exactly one time, no matter how many
> arguments are given (even if there's none).
>
> So the right solution is to drop double quotes.

Do you see any bug with the original?

If the problem is in fact that Solaris' /bin/sh is not standards
compliant, we shouldn't fix the script but instead make sure that the
shell used to run tracetool is the compliant one.

  parent reply	other threads:[~2010-09-14 16:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 11:26 [Qemu-devel] [Bug 636315] [NEW] configure and build errors on Solaris 10 due to /bin/sh usage Andreas Färber
2010-09-12 17:22 ` Blue Swirl
2010-09-12 17:35   ` Andreas Färber
2010-09-12 17:47     ` Blue Swirl
2010-09-12 17:58       ` Andreas Färber
2010-09-12 21:05         ` Blue Swirl
2010-09-12 22:02           ` Andreas Färber
2010-09-14 16:34             ` blueswirl
2010-09-14 20:37               ` Andreas Färber
2010-09-14 20:53                 ` Blue Swirl
2010-09-17 21:14                   ` Andreas Färber
2010-09-13  8:49           ` Michael Tokarev
2010-09-13 21:34             ` Andreas Färber
2010-09-14 16:41             ` Blue Swirl [this message]
2010-09-14 18:18               ` Michael Tokarev
2016-10-21 11:35 ` [Qemu-devel] [Bug 636315] " Thomas Huth

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='AANLkTimSwbnUYQn_=q4wWZYiHxdyy-bu0Wknh3awmR_4@mail.gmail.com' \
    --to=blauwirbel@gmail.com \
    --cc=636315@bugs.launchpad.net \
    --cc=andreas.faerber@web.de \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    /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).