All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Anibal Monsalve Salazar <anibal@debian.org>,
	Michal Marek <mmarek@suse.cz>, Anton Blanchard <anton@sambo.org>
Subject: [PATCH 2/4] kconfig: Check for if conditions in Kconfig for localmodconfig
Date: Wed, 03 Feb 2010 10:46:07 -0500	[thread overview]
Message-ID: <20100203154905.979883839@goodmis.org> (raw)
In-Reply-To: 20100203154605.461025238@goodmis.org

[-- Attachment #1: 0002-kconfig-Check-for-if-conditions-in-Kconfig-for-local.patch --]
[-- Type: text/plain, Size: 1972 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The streamline_config.pl misses the if conditions for checking
dependencies. For Kconfigs with the following construct:

 if MEDIA_SUPPORT

 config VIDEO_DEV

 [...]

If VIDEO_DEV was enabled, the script will miss the fact that MEDIA_SUPPORT
is also needed.

This patch changes streamline_config.pl to include if conditions into
the dependencies of configs.

Reported-by: Anton Blanchard <anton@sambo.org>
Tested-by: Anton Blanchard <anton@sambo.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 scripts/kconfig/streamline_config.pl |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 0d80082..9e66fa8 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -121,6 +121,8 @@ my %prompts;
 my %objects;
 my $var;
 my $cont = 0;
+my $iflevel = 0;
+my @ifdeps;
 
 # prevent recursion
 my %read_kconfigs;
@@ -146,6 +148,15 @@ sub read_kconfig {
 	    $state = "NEW";
 	    $config = $1;
 
+	    for (my $i = 0; $i < $iflevel; $i++) {
+		if ($i) {
+		    $depends{$config} .= " " . $ifdeps[$i];
+		} else {
+		    $depends{$config} = $ifdeps[$i];
+		}
+		$state = "DEP";
+	    }
+
 	# collect the depends for the config
 	} elsif ($state eq "NEW" && /^\s*depends\s+on\s+(.*)$/) {
 	    $state = "DEP";
@@ -166,6 +177,21 @@ sub read_kconfig {
 	    # note if the config has a prompt
 	    $prompt{$config} = 1;
 
+	# Check for if statements
+	} elsif (/^if\s+(.*\S)\s*$/) {
+	    my $deps = $1;
+	    # remove beginning and ending non text
+	    $deps =~ s/^[^a-zA-Z0-9_]*//;
+	    $deps =~ s/[^a-zA-Z0-9_]*$//;
+
+	    my @deps = split /[^a-zA-Z0-9_]+/, $deps;
+
+	    $ifdeps[$iflevel++] = join ':', @deps;
+
+	} elsif (/^endif/) {
+
+	    $iflevel-- if ($iflevel);
+
 	# stop on "help"
 	} elsif (/^\s*help\s*$/) {
 	    $state = "NONE";
-- 
1.6.5



  parent reply	other threads:[~2010-02-03 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 15:46 [PATCH 0/4][linux-next] kconfig: Updates to localmodconfig Steven Rostedt
2010-02-03 15:46 ` [PATCH 1/4] kconfig: Create include/generated for localmodconfig Steven Rostedt
2010-02-03 15:46 ` Steven Rostedt [this message]
2010-02-03 15:46 ` [PATCH 3/4] kconfig: Look in both /bin and /sbin for lsmod in streamline_config.pl Steven Rostedt
2010-02-03 15:46 ` [PATCH 4/4] kconfig: Add LSMOD=file to override the lsmod for localmodconfig Steven Rostedt
2010-02-03 16:07   ` Michal Marek
2010-02-03 16:12     ` Steven Rostedt
2010-02-03 16:20       ` [PATCH] kconfig: simplify LSMOD= handling Michal Marek
2010-02-03 16:49         ` [PATCH][linux-next] " Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100203154905.979883839@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=anibal@debian.org \
    --cc=anton@sambo.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.