Ports: Fix warning when building with useconfigure="false"

When building a port with `useconfigure="false"`, the `do_configure`
function invokes a `buildstep` with multiple positional arguments as the
command to execute.

It then tests whether the positional arguments evaluate to an emtpy
string, but could fail when multiple positional arguments were provided.
This resulted in the following warning when building the Composer port,
for example:

  ../.port_include.sh: line 16: [: echo: binary operator expected

Prevent this warning by testing against the number of positional
arguments, instead.
This commit is contained in:
Jelle Raaijmakers 2022-11-24 11:44:09 +01:00 committed by Linus Groh
parent fef0330ee5
commit 45108438ce
Notes: sideshowbarker 2024-07-17 04:10:28 +09:00

View file

@ -13,7 +13,7 @@ export MAKEJOBS="${MAKEJOBS:-$(nproc)}"
buildstep() {
local buildstep_name=$1
shift
if [ -z "$@" ]; then
if [ "$#" -eq '0' ]; then
"${buildstep_name}"
else
"$@"