From patchwork Tue Apr 13 21:03:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aristeu Rozanski X-Patchwork-Id: 92264 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3DL2ooP002516 for ; Tue, 13 Apr 2010 21:03:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753161Ab0DMVDL (ORCPT ); Tue, 13 Apr 2010 17:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45290 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752674Ab0DMVDK (ORCPT ); Tue, 13 Apr 2010 17:03:10 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3DL338R005475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Apr 2010 17:03:03 -0400 Received: from napanee.usersys.redhat.com (dhcp-100-18-204.bos.redhat.com [10.16.18.204]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3DL31pK008310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 13 Apr 2010 17:03:02 -0400 Received: from napanee.usersys.redhat.com (napanee.usersys.redhat.com [127.0.0.1]) by napanee.usersys.redhat.com (8.13.8/8.13.8) with ESMTP id o3DL3rTh025319; Tue, 13 Apr 2010 17:03:53 -0400 Received: (from aris@localhost) by napanee.usersys.redhat.com (8.13.8/8.13.8/Submit) id o3DL3rxM025318; Tue, 13 Apr 2010 17:03:53 -0400 X-Authentication-Warning: napanee.usersys.redhat.com: aris set sender to aris@redhat.com using -f Date: Tue, 13 Apr 2010 17:03:53 -0400 From: Aristeu Rozanski To: Randy Dunlap Cc: linux-kbuild@vger.kernel.org, Michal Marek , linux-kernel@vger.kernel.org, davej@redhat.com, kyle@redhat.com, vgoyal@redhat.com, arjan@linux.intel.com Subject: [PATCH] kconfig: introduce nonint_oldconfig and loose_nonint_oldconfig (v2) Message-ID: <20100413210352.GA31193@redhat.com> References: <20100413194747.GX31193@redhat.com> <20100413130031.d4dec19b.randy.dunlap@oracle.com> <20100413201759.GY31193@redhat.com> <4BC4D310.6060705@oracle.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4BC4D310.6060705@oracle.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Apr 2010 21:03:28 +0000 (UTC) --- linus-2.6.orig/scripts/kconfig/Makefile 2010-04-13 16:30:47.000000000 -0400 +++ linus-2.6/scripts/kconfig/Makefile 2010-04-13 16:48:24.000000000 -0400 @@ -69,6 +69,11 @@ localyesconfig: $(obj)/streamline_config fi $(Q)rm -f .tmp.config +nonint_oldconfig: $(obj)/conf + $< -b $(Kconfig) +loose_nonint_oldconfig: $(obj)/conf + $< -B $(Kconfig) + # Create new linux.pot file # Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files # The symlink is used to repair a deficiency in arch/um --- linus-2.6.orig/scripts/kconfig/conf.c 2010-04-13 16:30:47.000000000 -0400 +++ linus-2.6/scripts/kconfig/conf.c 2010-04-13 16:53:20.000000000 -0400 @@ -16,6 +16,9 @@ #define LKC_DIRECT_LINK #include "lkc.h" +/* Return codes */ +#define EUNSETOPT 2 /* if -B is used and unset config options were found */ + static void conf(struct menu *menu); static void check_conf(struct menu *menu); @@ -23,6 +26,8 @@ enum { ask_all, ask_new, ask_silent, + dont_ask, + dont_ask_dont_tell, set_default, set_yes, set_mod, @@ -360,7 +365,10 @@ static void conf(struct menu *menu) switch (prop->type) { case P_MENU: - if (input_mode == ask_silent && rootEntry != menu) { + if ((input_mode == ask_silent || + input_mode == dont_ask || + input_mode == dont_ask_dont_tell) && + rootEntry != menu) { check_conf(menu); return; } @@ -406,6 +414,8 @@ conf_childs: indent -= 2; } +static int return_value; + static void check_conf(struct menu *menu) { struct symbol *sym; @@ -418,10 +428,19 @@ static void check_conf(struct menu *menu if (sym && !sym_has_value(sym)) { if (sym_is_changable(sym) || (sym_is_choice(sym) && sym_get_tristate_value(sym) == yes)) { - if (!conf_cnt++) - printf(_("*\n* Restart config...\n*\n")); - rootEntry = menu_get_parent_menu(menu); - conf(rootEntry); + if (input_mode == dont_ask || + input_mode == dont_ask_dont_tell) { + if (input_mode == dont_ask && + sym->name && !sym_is_choice_value(sym)) { + fprintf(stderr,"CONFIG_%s\n",sym->name); + return_value = EUNSETOPT; + } + } else { + if (!conf_cnt++) + printf(_("*\n* Restart config...\n*\n")); + rootEntry = menu_get_parent_menu(menu); + conf(rootEntry); + } } } @@ -439,7 +458,7 @@ int main(int ac, char **av) bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - while ((opt = getopt(ac, av, "osdD:nmyrh")) != -1) { + while ((opt = getopt(ac, av, "osbBdD:nmyrh")) != -1) { switch (opt) { case 'o': input_mode = ask_silent; @@ -448,6 +467,12 @@ int main(int ac, char **av) input_mode = ask_silent; sync_kconfig = 1; break; + case 'b': + input_mode = dont_ask; + break; + case 'B': + input_mode = dont_ask_dont_tell; + break; case 'd': input_mode = set_default; break; @@ -525,6 +550,8 @@ int main(int ac, char **av) case ask_silent: case ask_all: case ask_new: + case dont_ask: + case dont_ask_dont_tell: conf_read(NULL); break; case set_no: @@ -586,12 +613,16 @@ int main(int ac, char **av) conf(&rootmenu); input_mode = ask_silent; /* fall through */ + case dont_ask: + case dont_ask_dont_tell: case ask_silent: /* Update until a loop caused no more changes */ do { conf_cnt = 0; check_conf(&rootmenu); - } while (conf_cnt); + } while (conf_cnt && + (input_mode != dont_ask && + input_mode != dont_ask_dont_tell)); break; } @@ -613,5 +644,5 @@ int main(int ac, char **av) exit(1); } } - return 0; + return return_value; }