From patchwork Wed Oct 28 00:42:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 7505821 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 284389F36A for ; Wed, 28 Oct 2015 00:45:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3EAC4208D0 for ; Wed, 28 Oct 2015 00:45:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41F0B20898 for ; Wed, 28 Oct 2015 00:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754905AbbJ1Amp (ORCPT ); Tue, 27 Oct 2015 20:42:45 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:33199 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754901AbbJ1Amn (ORCPT ); Tue, 27 Oct 2015 20:42:43 -0400 Received: by pabla5 with SMTP id la5so44896006pab.0 for ; Tue, 27 Oct 2015 17:42:42 -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=Khz3Zk5QHnZaxqjfhcKvbsB9wn2bWNaCybZa8jYBVyQ=; b=SGMp3+JWD5d/yyXORYMxto0KqRVsMLxi4JZvULoQ6W4ebUeZnW9KQLnV6ELZAiKdb2 Xq/nrnYJFwCIYedx67YLSxkPYsn1Dnu6itb0TgVbb+TFNQnXEHouY/N4HFYgoUxnYy0a pp1ZlyKihYjzXhLZG/WywQVb0EIgAjAWCYw8ofYslBwW7BqkuYRKdtVR/+QFMzWfpYC+ RuDWkkE1YNQPZ4QLAKLcKkCNvfOJgvbj6NbZdv2MLVx4IImvMJoH7EMVYWl6+niK3PAw tJZYbgt4t3CqkeUo10pis14O8NjdU3utHKGf7Hfn7yqxa0SLGLyVtOeSmZ1lgLqGKe8C bwJA== 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=Khz3Zk5QHnZaxqjfhcKvbsB9wn2bWNaCybZa8jYBVyQ=; b=PqTSKQlltJB0SUqijO9Jabb6VJEMZTg+PjsSz9hL6rS0DWbZtMVq1HJCblr+FujEkt fnpVpviSP62JGcJog1MCz5oepv8GAv7Jqh3b4UDTk/Yb/UOkgufoxgAGGtBchIedxigL iVZM5yV/DCdabPVFOl2sa4UshU6TqPyAW9O2fr+mn8ES662ultm2n/aq9K/MZZfirJ+q EWMH1SO7NHrV5BoUvYhvliFS5Jmln53mfF7wYn52RTW5RQPdn7IOF9DBZdTFqfV50QoJ NrdzSQvxMqfFe3B8DHavPf1knTEmo0nvNrmzEf5hSYy0mkf5uvWPLxNgBl8suVzUHU8V kn1w== X-Gm-Message-State: ALoCoQmiZK5uBBFXc2h3BxyXBF9RSYoVTcQGasVPD09Qe6oKwI8Luh6IyBYUE6ab11NuZxm3/uiQ X-Received: by 10.66.227.1 with SMTP id rw1mr31660433pac.138.1445992962755; Tue, 27 Oct 2015 17:42:42 -0700 (PDT) Received: from localhost.localdomain ([58.123.138.250]) by smtp.gmail.com with ESMTPSA id t9sm41801385pbs.17.2015.10.27.17.42.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Oct 2015 17:42:41 -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 04/10] merge_config.sh: exit non-0 in case of failures Date: Wed, 28 Oct 2015 09:42:05 +0900 Message-Id: <1445992931-28107-5-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=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 Reviewed-by: Darren Hart --- 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 fd0d537..c244042 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 ;; @@ -117,13 +124,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 @@ -136,7 +149,7 @@ if [ "$RUNMAKE" = "false" ]; then echo "# merged configuration written to $KCONFIG_CONFIG (needs make)" echo "#" clean_up - exit + exit $EXITVAL fi # If we have an output dir, setup the O= argument, otherwise leave @@ -152,10 +165,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" "$KCONFIG_CONFIG") if [ "x$REQUESTED_VAL" != "x$ACTUAL_VAL" ] ; then @@ -163,6 +174,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