[PATCH 1/9] scripts: kconfig: merge_config.sh: use POSIX '=' in test

Vincent Mailhol (Arm) posted 9 patches 2 weeks, 6 days ago
[PATCH 1/9] scripts: kconfig: merge_config.sh: use POSIX '=' in test
Posted by Vincent Mailhol (Arm) 2 weeks, 6 days ago
merge_config.sh yields this warning:

  ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator

This happens because the script runs under /bin/sh but compares
strings using the '==' operator, which is a bash extension. The POSIX
test command only specifies '=' for string equality.

Replace '==' with the POSIX-compatible '=' so the script works when
run with /bin/sh as intended.

Fixes: dfc97e1c5da5 ("scripts: kconfig: merge_config.sh: use awk in checks too")
Signed-off-by: Vincent Mailhol (Arm) <mailhol@kernel.org>
---
 scripts/kconfig/merge_config.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
index 735e1de450c6..073c6bec5245 100755
--- a/scripts/kconfig/merge_config.sh
+++ b/scripts/kconfig/merge_config.sh
@@ -381,7 +381,7 @@ END {
 	STRICT_MODE_VIOLATED=true
 fi
 
-if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
+if [ "$STRICT" = "true" ] && [ "$STRICT_MODE_VIOLATED" = "true" ]; then
 	echo "Requested and effective config differ"
 	exit 1
 fi

-- 
2.43.0
Re: [PATCH 1/9] scripts: kconfig: merge_config.sh: use POSIX '=' in test
Posted by Mikko Rapeli 2 weeks, 6 days ago
Hi,

On Tue, Mar 17, 2026 at 10:13:37AM +0100, Vincent Mailhol (Arm) wrote:
> merge_config.sh yields this warning:
> 
>   ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator
> 
> This happens because the script runs under /bin/sh but compares
> strings using the '==' operator, which is a bash extension. The POSIX
> test command only specifies '=' for string equality.
> 
> Replace '==' with the POSIX-compatible '=' so the script works when
> run with /bin/sh as intended.
> 
> Fixes: dfc97e1c5da5 ("scripts: kconfig: merge_config.sh: use awk in checks too")
> Signed-off-by: Vincent Mailhol (Arm) <mailhol@kernel.org>

This fix is already merged in kbuild trees:

https://lore.kernel.org/linux-kbuild/20260309121505.40454-1-o451686892@gmail.com/
https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git/log/?h=kbuild-fixes-for-next

Cheers,

-Mikko

> ---
>  scripts/kconfig/merge_config.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh
> index 735e1de450c6..073c6bec5245 100755
> --- a/scripts/kconfig/merge_config.sh
> +++ b/scripts/kconfig/merge_config.sh
> @@ -381,7 +381,7 @@ END {
>  	STRICT_MODE_VIOLATED=true
>  fi
>  
> -if [ "$STRICT" == "true" ] && [ "$STRICT_MODE_VIOLATED" == "true" ]; then
> +if [ "$STRICT" = "true" ] && [ "$STRICT_MODE_VIOLATED" = "true" ]; then
>  	echo "Requested and effective config differ"
>  	exit 1
>  fi
> 
> -- 
> 2.43.0
>
Re: [PATCH 1/9] scripts: kconfig: merge_config.sh: use POSIX '=' in test
Posted by Vincent Mailhol (Arm) 1 week, 5 days ago
On 3/17/26 10:30, Mikko Rapeli wrote:
> Hi,
> 
> On Tue, Mar 17, 2026 at 10:13:37AM +0100, Vincent Mailhol (Arm) wrote:
>> merge_config.sh yields this warning:
>>
>>   ./scripts/kconfig/merge_config.sh: 384: [: false: unexpected operator
>>
>> This happens because the script runs under /bin/sh but compares
>> strings using the '==' operator, which is a bash extension. The POSIX
>> test command only specifies '=' for string equality.
>>
>> Replace '==' with the POSIX-compatible '=' so the script works when
>> run with /bin/sh as intended.
>>
>> Fixes: dfc97e1c5da5 ("scripts: kconfig: merge_config.sh: use awk in checks too")
>> Signed-off-by: Vincent Mailhol (Arm) <mailhol@kernel.org>
> 
> This fix is already merged in kbuild trees:
> 
> https://lore.kernel.org/linux-kbuild/20260309121505.40454-1-o451686892@gmail.com/
> https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git/log/?h=kbuild-fixes-for-next

Noted! I actually started to write this before the other solution was
posted, but, anyway, this will be removed in v2.


Yours sincerely,
Vincent Mailhol