All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Fix _filter_qemu
Date: Tue, 16 Apr 2013 08:08:19 -0600	[thread overview]
Message-ID: <516D5B53.9090707@redhat.com> (raw)
In-Reply-To: <20130416131611.GA25650@stefanha-thinkpad.redhat.com>

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

On 04/16/2013 07:16 AM, Stefan Hajnoczi wrote:
>>> +    sed -e "s#^$(basename $QEMU_PROG):#QEMU_PROG:#g"
>>
>> Why spawn a basename process, when you can use shell to do the same?

> The problem with the POSIX shell string replacement is that the syntax
> is horrible.  I can never remember what ${%}, ${%%}, ${#} and
> %{##} do.  $(basename $QEMU_PROG) is clear (although it doesn't handle
> spaces in the filename!).

As written, it also doesn't handle a leading '-' in the name.  To be
robust, it should be $(basename -- "$QEMU_PROG") - and even then, it
still fails if $QEMU_PROG has a trailing newline (but no one is that
perverse in how they name their program, right?).  The shell variant
never goofs on any of those corner cases.  But I can totally understand
your aversion to line noise, and as I'm doubtful that anyone will run
the testsuite while trying to stress extreme corner-case $QEMU_PROG
naming conventions, I can certainly live with keeping $(basename
$QEMU_PROG) form for legibility.

-- 
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: 621 bytes --]

      parent reply	other threads:[~2013-04-16 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16  9:48 [Qemu-devel] [PATCH] qemu-iotests: Fix _filter_qemu Kevin Wolf
2013-04-16 12:26 ` Eric Blake
2013-04-16 13:16   ` Stefan Hajnoczi
2013-04-16 13:52     ` Markus Armbruster
2013-04-16 15:08       ` Stefan Hajnoczi
2013-04-16 13:56     ` Kevin Wolf
2013-04-16 14:08     ` Eric Blake [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=516D5B53.9090707@redhat.com \
    --to=eblake@redhat.com \
    --cc=kwolf@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.