From ff506cdeb7d8c7f98164a77b516d1bcc5c2d67f3 Mon Sep 17 00:00:00 2001 From: TIAN Yuanhao Date: Wed, 27 Jul 2022 07:08:22 -0700 Subject: [PATCH] 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 \ would match the assignment to BAR. Reported-by: Yann E. MORIN Signed-off-by: TIAN Yuanhao Cc: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Yann E. MORIN --- 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