All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG
@ 2022-07-27 14:08 TIAN Yuanhao
  2022-07-27 15:30 ` Yann E. MORIN
  2022-08-30 16:14 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: TIAN Yuanhao @ 2022-07-27 14:08 UTC (permalink / raw)
  To: buildroot; +Cc: TIAN Yuanhao, Yann E . MORIN

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>

---

I found something similar in uClibc-ng:

    TARGET_ARCH="x86_64"
    RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/"
---
 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
 
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG
  2022-07-27 14:08 [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG TIAN Yuanhao
@ 2022-07-27 15:30 ` Yann E. MORIN
  2022-08-30 16:14 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2022-07-27 15:30 UTC (permalink / raw)
  To: TIAN Yuanhao; +Cc: buildroot

Yuanhao, All,

On 2022-07-27 07:08 -0700, TIAN Yuanhao spake thusly:
> 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>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> 
> I found something similar in uClibc-ng:
> 
>     TARGET_ARCH="x86_64"
>     RUNTIME_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc/"
> ---
>  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
>  
> -- 
> 2.25.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG
  2022-07-27 14:08 [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG TIAN Yuanhao
  2022-07-27 15:30 ` Yann E. MORIN
@ 2022-08-30 16:14 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2022-08-30 16:14 UTC (permalink / raw)
  To: TIAN Yuanhao; +Cc: Yann E . MORIN, buildroot

>>>>> "TIAN" == TIAN Yuanhao <tianyuanhao3@163.com> writes:

 > 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>

Committed to 2022.05.x and 2022.02.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-30 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-27 14:08 [Buildroot] [PATCH] package/pkg-utils: refine KCONFIG_MUNGE_DOT_CONFIG TIAN Yuanhao
2022-07-27 15:30 ` Yann E. MORIN
2022-08-30 16:14 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.