OSDN Git Service

kconfig: fix localmodconfig
authorSam Ravnborg <sam@ravnborg.org>
Fri, 8 Jun 2018 21:48:31 +0000 (23:48 +0200)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 11 Jun 2018 00:16:30 +0000 (09:16 +0900)
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: 104daea149c4 ("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>
Tested-by: Kevin Locke <kevin@kevinlocke.name>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/kconfig/streamline_config.pl

index a2e83ab..4686531 100755 (executable)
@@ -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";