From patchwork Wed May 20 22:00:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 6450551 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 9DC2C9F1C1 for ; Wed, 20 May 2015 22:05:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C06CA203ED for ; Wed, 20 May 2015 22:05:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C89BA203B0 for ; Wed, 20 May 2015 22:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753750AbbETWFR (ORCPT ); Wed, 20 May 2015 18:05:17 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33312 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753686AbbETWCe (ORCPT ); Wed, 20 May 2015 18:02:34 -0400 Received: by padbw4 with SMTP id bw4so81627195pad.0 for ; Wed, 20 May 2015 15:02:33 -0700 (PDT) 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=keouaDUG1aGNlVnWMuQNQkb5HNit9lTmQmqRl5g5Bx4=; b=mZQoogw9UxZSE5rbN05Ab4fGJnwd7G4fKT/y7Pgn245Xq2bmxMw22nRVDoyzlgrCdL mGpR2oqx15GmyTG+qaBcNJywiS1KLK1TCba3d2DH+bhxrEfWh+s/o2kzNZnipf18Y+r6 VCoYJfuwUpNMn68m+WJv0o+MwkoMORl08wjJ7u2KFl46Pt2CJ8Z6AL9S5JpKhmTGzu/I C3pxx3VCW63f3qPAp7Zq7hZD08tn2E0uib1GHdxHXFtACmaJBYIEu8w7Vd8p5BUuke1E 5QZ/2HKWPMVBbtz657gMXrwyq8/7t9NT9AI/EwaM4fql0KNNDzLsoXSMo3qd5PjvHp+r RpiQ== X-Gm-Message-State: ALoCoQmniagBIeOjjzjiUmUNHxoApbAq9GRndV4qvrivqFf7Al4JFDg46EUtdgqzWZi4QGTtMT3T X-Received: by 10.66.150.196 with SMTP id uk4mr68218307pab.54.1432159353630; Wed, 20 May 2015 15:02:33 -0700 (PDT) Received: from brutus.lixom.net (173-13-129-225-sfba.hfc.comcastbusiness.net. [173.13.129.225]) by mx.google.com with ESMTPSA id ux6sm17193507pab.24.2015.05.20.15.02.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 15:02:32 -0700 (PDT) From: Olof Johansson To: yann.morin.1998@free.fr Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, dvhart@linux.intel.com, john.stultz@linaro.org, jwboyer@redhat.com, Olof Johansson Subject: [PATCH 01/10] merge_config.sh: factor out value parsing Date: Wed, 20 May 2015 15:00:51 -0700 Message-Id: <1432159260-39390-2-git-send-email-olof@lixom.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432159260-39390-1-git-send-email-olof@lixom.net> References: <1432159260-39390-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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 --- 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 ec8e203..430d002 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" } +getval() { + grep -w -e "$1" "$2" +} + RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false @@ -104,8 +108,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 @@ -145,8 +149,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" $OUTPUT/.config) + REQUESTED_VAL=$(getval "$CFG" "$TMP_FILE") + ACTUAL_VAL=$(getval "$CFG" "$OUTPUT/.config") if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then echo "Value requested for $CFG not in final .config" echo "Requested value: $REQUESTED_VAL"