]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
kconfig: Make localmodconfig handle environment variables
authorSteven Rostedt <srostedt@redhat.com>
Fri, 29 Oct 2010 04:56:46 +0000 (00:56 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 29 Oct 2010 05:03:42 +0000 (01:03 -0400)
The commit 838a2e55e6a4e9e8a10451ed2ef0f7a08dabdb04
 kbuild: migrate all arch to the kconfig mainmenu upgrade

Broke make localmodconfig. The reason was that it added a
environment variable to the kconfig source, which the
streamline_config.pl could not handle.

This patch changes streamline_config.pl to handle kconfig sources
using environment variables in their names.

Cc: Arnaud Lacombe <lacombar@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
scripts/kconfig/streamline_config.pl

index c70a27d924f0a74ae01762ff9e048847d1e5aa44..cc10bcfda64fe56c84cd059b1f90b29c012502b9 100644 (file)
@@ -137,7 +137,17 @@ sub read_kconfig {
     my $config;
     my @kconfigs;
 
-    open(KIN, "$ksource/$kconfig") || die "Can't open $kconfig";
+    my $source = "$ksource/$kconfig";
+    my $last_source = "";
+
+    # Check for any environment variables used
+    while ($source =~ /\$(\w+)/ && $last_source ne $source) {
+       my $env = $1;
+       $last_source = $source;
+       $source =~ s/\$$env/$ENV{$env}/;
+    }
+
+    open(KIN, "$source") || die "Can't open $kconfig";
     while (<KIN>) {
        chomp;