From patchwork Wed Oct 28 00:42:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 7505861 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A601A9F36A for ; Wed, 28 Oct 2015 00:46:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3FCB2061D for ; Wed, 28 Oct 2015 00:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB7B2205F4 for ; Wed, 28 Oct 2015 00:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754757AbbJ1Amh (ORCPT ); Tue, 27 Oct 2015 20:42:37 -0400 Received: from mail-pa0-f42.google.com ([209.85.220.42]:34976 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbbJ1Amd (ORCPT ); Tue, 27 Oct 2015 20:42:33 -0400 Received: by pasz6 with SMTP id z6so237743052pas.2 for ; Tue, 27 Oct 2015 17:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom_net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dzPsbx0j/Y0nb/Iw34dLrZbttenNeJ1w9g6GGfsCMV4=; b=adaRIrpb0g8am94ARNoM/LrO1ie//PZdKEzRYfjoUoTKn89SpcfLVe2GnUNRyxoBIf MswwEDbhd30iDtEhdmbBcqhu50h9mV6+xO6puqUFJXrq3zP11tkwVll3K0GBV7KNOOAM bMA/Tzlg4Ai7kd+3YzINE7s0PdohFgrJHg4sSkRAr2KdF6srfIe6Hn4LW6tIc89xedxN Rb1Pvia0r4ty9hwwouDFZ6ndZ3KZ6q/YeusIQqHtQUSwgM2oKmGZ4u5FL6W7TrcAq20G SAKrJrsgLzGh5ADMjuNRBBq69CJ0uJ0wFS/NZYE9KmmTSS9GjupJrapH9ziAggh2WvBM OFag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dzPsbx0j/Y0nb/Iw34dLrZbttenNeJ1w9g6GGfsCMV4=; b=dSYz/+FOIg0WtYxBK7T5+0L+imvI3z1m6nFTgUn8vkzinfXQR0h4vjAXxqaylsaG6U duOdx6nWRS1s0G8Id9TYmTepOLCoyjTmmDSmusJqjqclEV4BywgDkyIMnz8jetA5rUwO 3OXuH5eMWZ5eI8rp6nR5pzyFdvD6csjvhr0J3FdlaaWmJ3xsVV1KWiCZsVWuJG5o1AgP Esv+w+1jrnHKvFBU/Xsdn/KSRn1MLUTDgH5bjokk5L1hUep8Cfur4YM2yJkuAepF39qy xpaK/CKMDE/BWkzJj3iaBGoZjXiNlrdJE+Typ+pLtfgiCjuGBOdujNUKbtRA1ulaqSWb GC3w== X-Gm-Message-State: ALoCoQnKeGp5col0lj14x9EAKJeGQ80exnm/O0PAZzEcLxWvXf5DSjBhlKp5y71ZWu0xZ5dzDoQg X-Received: by 10.66.250.202 with SMTP id ze10mr6797259pac.132.1445992953311; Tue, 27 Oct 2015 17:42:33 -0700 (PDT) Received: from localhost.localdomain ([58.123.138.250]) by smtp.gmail.com with ESMTPSA id t9sm41801385pbs.17.2015.10.27.17.42.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Oct 2015 17:42:32 -0700 (PDT) From: Olof Johansson To: Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, dvhart@linux.intel.com, Olof Johansson Subject: [PATCH 01/10] merge_config.sh: factor out value parsing Date: Wed, 28 Oct 2015 09:42:02 +0900 Message-Id: <1445992931-28107-2-git-send-email-olof@lixom.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1445992931-28107-1-git-send-email-olof@lixom.net> References: <1445992931-28107-1-git-send-email-olof@lixom.net> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since we want to adjust the line later on to deal with CONFIG_FOO=n, let's make a function for it so we have only one place to change it in. Signed-off-by: Olof Johansson Reviewed-by: Darren Hart --- scripts/kconfig/merge_config.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index 67d1314..d8cd913 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -35,6 +35,10 @@ usage() { echo " -O dir to put generated output files. Consider setting \$KCONFIG_CONFIG instead." } +getval() { + grep -w -e "$1" "$2" +} + RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false @@ -116,8 +120,8 @@ for MERGE_FILE in $MERGE_LIST ; do for CFG in $CFG_LIST ; do grep -q -w $CFG $TMP_FILE || continue - PREV_VAL=$(grep -w $CFG $TMP_FILE) - NEW_VAL=$(grep -w $CFG $MERGE_FILE) + PREV_VAL=$(getval "$CFG" "$TMP_FILE") + NEW_VAL=$(getval "$CFG" "$MERGE_FILE") if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then echo Value of $CFG is redefined by fragment $MERGE_FILE: echo Previous value: $PREV_VAL @@ -157,8 +161,8 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET # Check all specified config values took (might have missed-dependency issues) for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do - REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) - ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") + REQUESTED_VAL=$(getval "$CFG" "$TMP_FILE") + ACTUAL_VAL=$(getval "$CFG" "$KCONFIG_CONFIG") if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL"