diff mbox

kconfig: fix localmodconfig

Message ID 20180608215338.GA28473@ravnborg.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sam Ravnborg June 8, 2018, 9:53 p.m. UTC
From 47857284fd19ef953e3beb7338154924a74b62d2 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Fri, 8 Jun 2018 23:48:31 +0200
Subject: [PATCH 1/1] kconfig: fix localmodconfig

When kconfig syntax moved to use $(FOO) for environment variables
localmodconfig was not updated.
Fix so it now works with the new syntax $(FOO)

Fixes: 104daea149c45cc84842ce77a9bd6436d19f3dd8 ("kconfig: reference environment variables directly and remove 'option env='")
Reported-by: Kevin Locke <kevin@kevinlocke.name>
Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/streamline_config.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kevin Locke June 9, 2018, 5:25 a.m. UTC | #1
On Fri, 2018-06-08 at 23:53 +0200, Sam Ravnborg wrote:
> When kconfig syntax moved to use $(FOO) for environment variables
> localmodconfig was not updated.
> Fix so it now works with the new syntax $(FOO)
> 
> Fixes: 104daea149c45cc84842ce77a9bd6436d19f3dd8 ("kconfig: reference environment variables directly and remove 'option env='")

I can confirm `make localmodconfig` from 104daea149c4 with this patch
applied creates the same .config as it did in 104daea149c4^ and that
it creates a plausible .config (which I haven't built/tested yet) when
applied to master.

Works for me.  Thanks for the very fast fix!

Tested-by: Kevin Locke <kevin@kevinlocke.name>

Cheers,
Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada June 10, 2018, 1:29 p.m. UTC | #2
2018-06-09 6:53 GMT+09:00 Sam Ravnborg <sam@ravnborg.org>:
> From 47857284fd19ef953e3beb7338154924a74b62d2 Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Fri, 8 Jun 2018 23:48:31 +0200
> Subject: [PATCH 1/1] kconfig: fix localmodconfig
>
> When kconfig syntax moved to use $(FOO) for environment variables
> localmodconfig was not updated.
> Fix so it now works with the new syntax $(FOO)
>
> Fixes: 104daea149c45cc84842ce77a9bd6436d19f3dd8 ("kconfig: reference environment variables directly and remove 'option env='")
> Reported-by: Kevin Locke <kevin@kevinlocke.name>
> Reported-by: Andrei Vagin <avagin@virtuozzo.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> ---


Applied to linux-kbuild.  Thanks!


>  scripts/kconfig/streamline_config.pl | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
> index a2e83ab17de3..4686531e2f8c 100755
> --- a/scripts/kconfig/streamline_config.pl
> +++ b/scripts/kconfig/streamline_config.pl
> @@ -165,10 +165,10 @@ sub read_kconfig {
>      my $last_source = "";
>
>      # Check for any environment variables used
> -    while ($source =~ /\$(\w+)/ && $last_source ne $source) {
> +    while ($source =~ /\$\((\w+)\)/ && $last_source ne $source) {
>         my $env = $1;
>         $last_source = $source;
> -       $source =~ s/\$$env/$ENV{$env}/;
> +       $source =~ s/\$\($env\)/$ENV{$env}/;
>      }
>
>      open(my $kinfile, '<', $source) || die "Can't open $kconfig";
> --
> 2.12.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index a2e83ab17de3..4686531e2f8c 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -165,10 +165,10 @@  sub read_kconfig {
     my $last_source = "";
 
     # Check for any environment variables used
-    while ($source =~ /\$(\w+)/ && $last_source ne $source) {
+    while ($source =~ /\$\((\w+)\)/ && $last_source ne $source) {
 	my $env = $1;
 	$last_source = $source;
-	$source =~ s/\$$env/$ENV{$env}/;
+	$source =~ s/\$\($env\)/$ENV{$env}/;
     }
 
     open(my $kinfile, '<', $source) || die "Can't open $kconfig";