qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] configure: remove bashism (since 2010)


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] configure: remove bashism (since 2010)
Date: Wed, 9 Dec 2015 19:51:13 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/09/2015 05:53 PM, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
> 
> "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

> 
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]