All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: QEMU <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] configure: remove bashism (since 2010)
Date: Thu, 10 Dec 2015 10:46:34 +0100	[thread overview]
Message-ID: <CAJ+F1CJV=wKXRpf+K82fkQZW8aD=Wh61R+ZK_o9cwDLt=8BmAQ@mail.gmail.com> (raw)
In-Reply-To: <5668E8A1.90705@redhat.com>

Hi

On Thu, Dec 10, 2015 at 3:51 AM, Eric Blake <eblake@redhat.com> wrote:
> On 12/09/2015 05:53 PM, marcandre.lureau@redhat.com wrote:
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> "type" is not POSIX shell, but a bashism. (found thanks to shellcheck)
>
> NACK.  'type' is POSIX, and shellcheck is buggy.
>
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html

So is checkbashisms then. I am just spreading that wrong idea then :)

>
>>
>> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
>> ---
>>  configure | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index ba57b3f..90eff82 100755
>> --- a/configure
>> +++ b/configure
>> @@ -158,7 +158,7 @@ symlink() {
>>  # check whether a command is available to this shell (may be either an
>>  # executable or a builtin)
>>  has() {
>> -    type "$1" >/dev/null 2>&1
>> +    which "$1" >/dev/null 2>&1
>
> Conversely, 'which' is _not_ POSIX, and therefore less portable than 'type'.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>



-- 
Marc-André Lureau

      reply	other threads:[~2015-12-10  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10  0:53 [Qemu-devel] [PATCH] configure: remove bashism (since 2010) marcandre.lureau
2015-12-10  0:57 ` Marc-André Lureau
2015-12-10  2:52   ` Eric Blake
2015-12-10  2:51 ` Eric Blake
2015-12-10  9:46   ` Marc-André Lureau [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='CAJ+F1CJV=wKXRpf+K82fkQZW8aD=Wh61R+ZK_o9cwDLt=8BmAQ@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=eblake@redhat.com \
    --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 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.