From patchwork Wed May 20 22:00:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olof Johansson X-Patchwork-Id: 6450361 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 7BE4F9F1C1 for ; Wed, 20 May 2015 22:03:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92B3E200E3 for ; Wed, 20 May 2015 22:03:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 830D32021B for ; Wed, 20 May 2015 22:03:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754144AbbETWCx (ORCPT ); Wed, 20 May 2015 18:02:53 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34956 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754119AbbETWCo (ORCPT ); Wed, 20 May 2015 18:02:44 -0400 Received: by pacwv17 with SMTP id wv17so81626276pac.2 for ; Wed, 20 May 2015 15:02:44 -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=PLiha8LlsSNyJTdWAsckUrvm1lNvXm/3J8FEZz+P/g0=; b=BBlDAC+LQlI4/r7CmcL4Bk1Tzy7zWu/hC8ASi6c0jsmd31CRzrUH8FhK6SEr8oU13L R33j2U9iMN1cKKg3E19ADJq1qt1yTPS9/OYBRzZPwhIHR7tzyY6QsZonnZ+/NP0LzCCt HNY7+2GWt7HRJyKlcmfWWrQBnQTA6xEHkRwru/5v0yuwQMr10pkB6TeEUG6sbR1oXnWe O/Q5cfJT2v68BCTHWfrysPr6Vsqtf/4BMV+KPjz6aqFbCMm/iPh+wfQOoQ9MFsRmFaOS ce5/hEflkJTwa81Ivkf2G5dSr3ibRRXJl+e6nZMtD6u56oy7SFuWOs5av8eC2dM+U9/4 2jdQ== X-Gm-Message-State: ALoCoQn/UeDFMB6O188Xnsg2D6uFrR/v6ajO/V6ZLCirvVOEkhpLTr048oRaaMql2PcHnjWHO3Gt X-Received: by 10.70.101.2 with SMTP id fc2mr68078429pdb.77.1432159364385; Wed, 20 May 2015 15:02:44 -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.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2015 15:02:43 -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 09/10] merge_config.sh: allow single configs to be passed in on cmdline Date: Wed, 20 May 2015 15:00:59 -0700 Message-Id: <1432159260-39390-10-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 Treat CONFIG_FOO=.. on the command line the same way as a single-entry file would. Signed-off-by: Olof Johansson --- scripts/kconfig/merge_config.sh | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/scripts/kconfig/merge_config.sh b/scripts/kconfig/merge_config.sh index fd27294..bcb9649 100755 --- a/scripts/kconfig/merge_config.sh +++ b/scripts/kconfig/merge_config.sh @@ -1,8 +1,8 @@ #!/bin/sh -# merge_config.sh - Takes a list of config fragment values, and merges -# them one by one. Provides warnings on overridden values, and specified -# values that did not make it to the resulting .config file (due to missed -# dependencies or config symbol removal). +# merge_config.sh - Takes a list of config fragment filenames or configuration +# value, and merges them one by one. Provides warnings on overridden values, +# and specified values that did not make it to the resulting .config file +# (due to missed dependencies or config symbol removal). # # Portions reused from kconf_check and generate_cfg: # http://git.yoctoproject.org/cgit/cgit.cgi/yocto-kernel-tools/tree/tools/kconf_check @@ -100,7 +100,26 @@ fi MERGE_LIST=$* SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(CONFIG_[a-zA-Z0-9_]*\)[= ].*/\2/p" -TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) +TMP_FILE=$(mktemp $OUTPUT/.tmp.config.XXXXXXXXXX) + +CLEAN_FILES=$TMP_FILE + +# Process cmdline configs into temporary fragments +for ENTRY in $MERGE_LIST ; do + case $ENTRY in + CONFIG*) + FF=$(mktemp $OUTPUT/.temp.frag-cmdline.XXXXX) + CLEAN_FILES="$CLEAN_FILES $FF" + echo $ENTRY > $FF + NEW_LIST="$NEW_LIST $FF" + ;; + *) + NEW_LIST="$NEW_LIST $ENTRY" + ;; + esac +done + +MERGE_LIST=$NEW_LIST echo "Using $INITFILE as base" cat $INITFILE > $TMP_FILE