From patchwork Wed May 20 22:00:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 6450521 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8F045C0432 for ; Wed, 20 May 2015 22:05:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA72E203ED for ; Wed, 20 May 2015 22:04:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A689A203B0 for ; Wed, 20 May 2015 22:04:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754672AbbETWEp (ORCPT ); Wed, 20 May 2015 18:04:45 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35811 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158AbbETWCi (ORCPT ); Wed, 20 May 2015 18:02:38 -0400 Received: by pacwv17 with SMTP id wv17so81623353pac.2 for ; Wed, 20 May 2015 15:02:37 -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=U1hhnZSwPVQTzpTI6pDEq4RjogViCAdV/FdZWogRJ8A=; b=RhLJZ4MUE8RL/JDf7xajGMnkedce2AsXkAa2HGSbSzdfQGkuBgwRu1QCvgVQvd2Vvg /UflttcHdOJI7XlEyl2de9Y0NfZY+V20OgjIXx3w5gyE9ohvpcAnV1vmYnWoanTZ++kW jtGnu+UaUjWmzIhlc1yUHbWZHKAk80e14YrLzjdEvo78SKOCTf72Bpg2p99yU/EjXbG2 nmEUrtpw8E7BMJiAFj/fGFuXEljEYQaeU3Oz1hFvRXSonoTUFNUDf+aeHLmnh3MQjQgS ikiYfrjwiI0Q697Yish1pwN6lWH8CIlHheblLo7zRCPP5l7m66RHM87w4JHLvIsiTcZn +pkw== X-Gm-Message-State: ALoCoQmvtJ5Qiyl+oll6SMGTcxTh4c9zm+04RUvUBngC+dAa17rUYqhn19Cobj5yJBzgyNuyCF0a X-Received: by 10.68.68.166 with SMTP id x6mr51634009pbt.161.1432159357723; Wed, 20 May 2015 15:02:37 -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.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 15:02:36 -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 04/10] merge_config.sh: exit non-0 in case of failures Date: Wed, 20 May 2015 15:00:54 -0700 Message-Id: <1432159260-39390-5-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=unavailable 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 Exit with non-0 value in cases where there was a failure to set an option. Also, add a '-e' during which the conflict warnings are considered failures (-e -r will result in these being failures, -r will result in them just being reported). Signed-off-by: Olof Johansson --- scripts/kconfig/merge_config.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index fb0c463..2364246 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -20,14 +20,17 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # See the GNU General Public License for more details. +EXITVAL=0 + clean_up() { rm -f $TMP_FILE - exit + exit $EXITVAL } trap clean_up HUP INT TERM usage() { echo "Usage: $0 [OPTIONS] [CONFIG [...]]" + echo " -e consider conflicting overrides to be errors" echo " -h display this help text" echo " -m only merge the fragments, do not execute the make command" echo " -n use allnoconfig instead of alldefconfig" @@ -39,6 +42,7 @@ getval() { grep -w -e "$1" "$2" } +CONF_IS_ERR=false RUNMAKE=true ALLTARGET=alldefconfig WARNREDUN=false @@ -46,6 +50,9 @@ OUTPUT=. while true; do case $1 in + "-e") + CONF_IS_ERR=true + ;; "-n") ALLTARGET=allnoconfig ;; @@ -105,13 +112,19 @@ for MERGE_FILE in $MERGE_LIST ; do grep -q -w $CFG $TMP_FILE || continue PREV_VAL=$(getval "$CFG" "$TMP_FILE") NEW_VAL=$(getval "$CFG" "$MERGE_FILE") + WARN=false if [ "x$PREV_VAL" != "x$NEW_VAL" ] ; then echo Value of $CFG is redefined by fragment $MERGE_FILE: echo Previous value: $PREV_VAL echo New value: $NEW_VAL echo + WARN=true elif [ "$WARNREDUN" = "true" ]; then echo Value of $CFG is redundant by fragment $MERGE_FILE: + WARN=true + fi + if [ "$CONF_IS_ERR" = "true" -a "$WARN" = "true" ] ; then + EXITVAL=1 fi sed -i "/$CFG[ =]/d" $TMP_FILE done >&2 @@ -124,7 +137,7 @@ if [ "$RUNMAKE" = "false" ]; then echo "# merged configuration written to $OUTPUT/.config (needs make)" echo "#" clean_up - exit + exit $EXITVAL fi # If we have an output dir, setup the O= argument, otherwise leave @@ -140,10 +153,8 @@ fi # allnoconfig: Fills in any missing symbols with # CONFIG_* is not set 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=$(getval "$CFG" "$TMP_FILE") ACTUAL_VAL=$(getval "$CFG" "$OUTPUT/.config") if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then @@ -151,6 +162,7 @@ for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do echo "Requested value: $REQUESTED_VAL" echo "Actual value: $ACTUAL_VAL" echo "" + EXITVAL=1 fi >&2 done