From patchwork Thu Jul 12 12:50:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 10521653 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3E73A602B3 for ; Thu, 12 Jul 2018 12:50:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A2CE29580 for ; Thu, 12 Jul 2018 12:50:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2899F29555; Thu, 12 Jul 2018 12:50:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C3429633 for ; Thu, 12 Jul 2018 12:50:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732181AbeGLM7r (ORCPT ); Thu, 12 Jul 2018 08:59:47 -0400 Received: from mga06.intel.com ([134.134.136.31]:39614 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726946AbeGLM7r (ORCPT ); Thu, 12 Jul 2018 08:59:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2018 05:50:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,343,1526367600"; d="scan'208";a="55991527" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga007.jf.intel.com with SMTP; 12 Jul 2018 05:50:14 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 12 Jul 2018 15:50:13 +0300 From: Ville Syrjala To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Subject: [RFC][PATCH] kconfig: Add "m or y" and "y or m" answers for oldconfig Date: Thu, 12 Jul 2018 15:50:13 +0300 Message-Id: <20180712125013.14285-1-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.16.4 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä Make it possible to answer "m or y" or "y or m" to oldconfig so that scripted kernel builds can easily enable new features not present in the existing .config. The particular use case I have in mind is continuous integration where you probably want to test build any new features. Currently you would have to either blindly try both 'y' and 'm' answers or parse the output to know which one will be accepted. Cc: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Ville Syrjälä --- scripts/kconfig/conf.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 671ff5364497..8038f9a6b9f4 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -201,15 +201,33 @@ static int conf_sym(struct menu *menu) continue; case 'm': case 'M': - newval = mod; - if (!line[1]) + if (!strcmp(line, "m or y") || + !strcmp(line, "M or Y")) { + if (sym_tristate_within_range(sym, mod)) + newval = mod; + else + newval = yes; break; + } else { + newval = mod; + if (!line[1]) + break; + } continue; case 'y': case 'Y': - newval = yes; - if (!line[1] || !strcmp(&line[1], "es")) + if (!strcmp(line, "y or m") || + !strcmp(line, "Y or M")) { + if (sym_tristate_within_range(sym, yes)) + newval = yes; + else + newval = mod; break; + } else { + newval = yes; + if (!line[1] || !strcmp(&line[1], "es")) + break; + } continue; case 0: newval = oldval;