From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.85.221.65, mailfrom: philmd@redhat.com) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by groups.io with SMTP; Wed, 24 Jul 2019 05:30:36 -0700 Received: by mail-wr1-f65.google.com with SMTP id p17so46762139wrf.11 for ; Wed, 24 Jul 2019 05:30:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/iTwtk/2DrtoTiTTziXZx7haQWJqJaQuKVda0Eeby4g=; b=QGFysiuBKY/orN4dNFcEgRbuEU6NpVVRq+otconXEQUXDoeJvgxa0WoXI/NpNBq32o QTnXANCsotyV1d6JziF/NV4Kp9AOEhPV1kts9vQnkAtSTjkxNfqKTlrbw99d0/s+DjUC 1wqB0thKG06deAGyW7NEeveHzyGAlCvTDk4eUzokT8Fh56ET7a9RuSkgszxAj34OGpaH vne6fTbUXeNJT2xJvcMP/nK2KWfUqj4gB6cNfb3FxaXhK14vYZCzJgpgkbeN4syt5lgb AW4riLxiRUyqkWz8t8USNgsAvcH2m7nimLtF5oTWvwBs76TDykeaEve8eL3tnDJg+uRA o9Fg== X-Gm-Message-State: APjAAAVZQl6tu+oVphCwG7T+suyU5xhpv8zrL0xwXVHsu+0UV4TdCPki rVdTZpaSg+gq+wgWrcdUtIepqg== X-Google-Smtp-Source: APXvYqxlRyYDxoW677vKg8P4qrv7fU4QatQxJNRycX15cjf5jVXklgKLQGaCVhGkwEkNzIvOYklHEA== X-Received: by 2002:a5d:468a:: with SMTP id u10mr32140186wrq.177.1563971434859; Wed, 24 Jul 2019 05:30:34 -0700 (PDT) Return-Path: Received: from [10.201.33.105] ([195.166.127.210]) by smtp.gmail.com with ESMTPSA id z7sm43442983wrh.67.2019.07.24.05.30.33 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 05:30:34 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH] OvmfPkg/build.sh: use POSIX 'command -v' instead of 'which'. To: devel@edk2.groups.io, rebecca@bsdio.com, jordan.l.justen@intel.com, lersek@redhat.com, ard.biesheuvel@linaro.org References: <20190724004947.55202-1-rebecca@bsdio.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Wed, 24 Jul 2019 14:30:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190724004947.55202-1-rebecca@bsdio.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Rebecca, On 7/24/19 2:49 AM, rebecca@bsdio.com wrote: > Signed-off-by: Rebecca Cran > --- > OvmfPkg/build.sh | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh > index e94aa2a37e..1c28e65404 100755 > --- a/OvmfPkg/build.sh > +++ b/OvmfPkg/build.sh > @@ -174,11 +174,11 @@ case $PROCESSOR in > # The user set the QEMU_COMMAND variable. We'll use it to run QEMU. > # > : > - elif [ -x `which qemu-system-i386` ]; then > + elif command -v qemu-system-i386; then > QEMU_COMMAND=qemu-system-i386 > - elif [ -x `which qemu-system-x86_64` ]; then > + elif command -v qemu-system-x86_64; then > QEMU_COMMAND=qemu-system-x86_64 > - elif [ -x `which qemu` ]; then > + elif command -v qemu; then > QEMU_COMMAND=qemu > else > echo Unable to find QEMU for IA32 architecture! > @@ -242,12 +242,12 @@ FV_DIR=$BUILD_ROOT/FV > BUILD_ROOT_ARCH=$BUILD_ROOT/$BUILD_ROOT_ARCH > QEMU_FIRMWARE_DIR=$BUILD_ROOT/QEMU > > -if [[ ! -f `which build` || ! -f `which GenFv` ]]; > +if ! command -v build || ! command -v GenFv; > then > # build the tools if they don't yet exist. Bin scheme > echo Building tools as they are not in the path > make -C $WORKSPACE/BaseTools > -elif [[ ( -f `which build` || -f `which GenFv` ) && ! -d $EDK_TOOLS_PATH/Source/C/bin ]]; > +elif [[ ( $(command -v build) || $(command -v GenFv) ) && ! -d $EDK_TOOLS_PATH/Source/C/bin ]]; Why add $() ? > then > # build the tools if they don't yet exist. BinWrapper scheme > echo Building tools no $EDK_TOOLS_PATH/Source/C/bin directory >