qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] configure: Replace which(1) with


From: Peter Maydell
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] configure: Replace which(1) with "command -v"
Date: Wed, 19 Nov 2014 08:18:58 +0000

On 19 November 2014 07:13, Fam Zheng <address@hidden> wrote:
> Because which(1) is not always installed, whereas "command -v" is
> the more native way to check for a command.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 47048f0..986a13d 100755
> --- a/configure
> +++ b/configure
> @@ -2727,7 +2727,7 @@ fi
>  if test "$modules" = yes; then
>      shacmd_probe="sha1sum sha1 shasum"
>      for c in $shacmd_probe; do
> -        if which $c >/dev/null 2>&1; then
> +        if command -v $c >/dev/null 2>&1; then
>              shacmd="$c"
>              break
>          fi

Configure already provides the shell function "has"
for checking for existence of a command -- can we just
use that?

thanks
-- PMM



reply via email to

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