[Buildroot] [git commit branch/2022.05.x] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG

Peter Korsgaard peter at korsgaard.com
Tue Aug 30 16:14:37 UTC 2022


commit: https://git.buildroot.net/buildroot/commit/?id=6fb47a01cafa4b456bdfc69578ca49007ab3cad5
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2022.05.x

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 at free.fr>
Signed-off-by: TIAN Yuanhao <tianyuanhao3 at 163.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
(cherry picked from commit ff506cdeb7d8c7f98164a77b516d1bcc5c2d67f3)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/pkg-utils.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index e5dba2add0..6ece27baa2 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -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
 



More information about the buildroot mailing list