From 45108438ce39101e8e9ff9230b5152f64d89326c Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Thu, 24 Nov 2022 11:44:09 +0100 Subject: [PATCH] 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. --- Ports/.port_include.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index bf9e58a009..0e14c0b8a7 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -13,7 +13,7 @@ export MAKEJOBS="${MAKEJOBS:-$(nproc)}" buildstep() { local buildstep_name=$1 shift - if [ -z "$@" ]; then + if [ "$#" -eq '0' ]; then "${buildstep_name}" else "$@"