package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG

Given a .config with:

    FOO="1234"
    BAR="$(FOO)"

and then:

    $(call KCONFIG_SET_OPT,FOO,azerty)

would yield a .config with just:

    FOO="azerty"

because \<FOO\> would match the assignment to BAR.

Reported-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
TIAN Yuanhao 2022-07-27 07:08:22 -07:00 committed by Yann E. MORIN
parent 78727d83e6
commit ff506cdeb7

View File

@ -22,7 +22,7 @@ KCONFIG_DOT_CONFIG = $(strip \
# KCONFIG_MUNGE_DOT_CONFIG (option, newline [, file])
define KCONFIG_MUNGE_DOT_CONFIG
$(SED) "/\\<$(strip $(1))\\>/d" $(call KCONFIG_DOT_CONFIG,$(3)) && \
$(SED) '/^\(# \)\?$(strip $(1))\>/d' $(call KCONFIG_DOT_CONFIG,$(3)) && \
echo '$(strip $(2))' >> $(call KCONFIG_DOT_CONFIG,$(3))
endef