Skip to contentSkip to conversation

kconfig: fix localmodconfig

PATCH In review Sam Ravnborg 3 participants 3 messages Jun 8, 2018 – Jun 10, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kconfig: fix localmodconfig

From 47857284fd19ef953e3beb7338154924a74b62d2 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
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='")
---
 scripts/kconfig/streamline_config.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kconfig/streamline_config.pl +2 -2
index a2e83ab17de3..4686531e2f8c 100755
@@ -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";
Signature · 1 line
2.12.0
Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sam Ravnborg

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!

Cheers,
Kevin

#2 lore raw
In reply to Sam Ravnborg

2018-06-09 6:53 GMT+09:00 Sam Ravnborg <[email protected]>:

Quoted 9 lines

From 47857284fd19ef953e3beb7338154924a74b62d2 Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <[email protected]>
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)

Quoted 5 lines
Fixes 104daea149c45cc84842ce77a9bd6436d19f3dd8 ("kconfig: reference environment variables directly and remove 'option env='")

---

Applied to linux-kbuild. Thanks!

Quoted 27 lines
 scripts/kconfig/streamline_config.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/kconfig/streamline_config.pl +2 -3
index a2e83ab17de3..4686531e2f8c 100755
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Best Regards
Masahiro Yamada