From patchwork Thu Sep 20 11:44:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Patzlaff, Marcel" X-Patchwork-Id: 972356 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pilz.de Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GFJT6V89z9s4V for ; Thu, 20 Sep 2018 21:44:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8E35622CC6; Thu, 20 Sep 2018 11:44:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eqYGb1O7U5iU; Thu, 20 Sep 2018 11:44:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 49FAF22B7A; Thu, 20 Sep 2018 11:44:33 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 167E21C0492 for ; Thu, 20 Sep 2018 11:44:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 13DCD84FA8 for ; Thu, 20 Sep 2018 11:44:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rgd91hizdMEi for ; Thu, 20 Sep 2018 11:44:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.pilz.de (mail1.pilz.de [212.211.209.113]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1333284E7C for ; Thu, 20 Sep 2018 11:44:29 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.53,398,1531778400"; d="scan'208";a="2903121" Received: from unknown (HELO srv-desm01) ([172.20.2.85]) by mail1.pilz.de with ESMTP; 20 Sep 2018 13:44:27 +0200 Received: from srv-dema02.de.pilz.local ([172.16.206.6]) by srv-desm01 (IBM Domino Release 9.0.1FP8) with ESMTP id 2018092013442433-4847110 ; Thu, 20 Sep 2018 13:44:24 +0200 Received: from mpa-linux.de.pilz.local ([172.16.204.213]) by srv-dema02.de.pilz.local (IBM Domino Release 9.0.1FP8 HF475) with ESMTP id 2018092013442665-6071 ; Thu, 20 Sep 2018 13:44:26 +0200 From: Marcel Patzlaff To: buildroot@buildroot.org Date: Thu, 20 Sep 2018 13:44:16 +0200 Message-Id: <20180920114416.13976-1-m.patzlaff@pilz.de> X-Mailer: git-send-email 2.17.1 X-MIMETrack: Itemize by SMTP Server on DEMA02/SRV/Pilz(Release 9.0.1FP8 HF475|July 13, 2017) at 20.09.2018 13:44:26, Serialize by ntm_grab.EXE on DEMA02/SRV/Pilz(Release 9.0.1FP8 HF475|July 13, 2017) at 20.09.2018 13:44:26, Serialize complete at 20.09.2018 13:44:26, Serialize by ntm_grab.EXE on DEMA02/SRV/Pilz(Release 9.0.1FP8 HF475|July 13, 2017) at 20.09.2018 13:44:27, Serialize complete at 20.09.2018 13:44:27, Serialize by Router on DEMA02/SRV/Pilz(Release 9.0.1FP8 HF475|July 13, 2017) at 20.09.2018 13:44:27, Itemize by SMTP Server on desm01/dmz(Release 9.0.1FP8|February 23, 2017) at 20.09.2018 13:44:24, Serialize by Router on desm01/dmz(Release 9.0.1FP8|February 23, 2017) at 20.09.2018 13:44:24, Serialize complete at 20.09.2018 13:44:24 X-TNEFEvaluated: 1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] utils/diffconfig: Removed BR2_* prefix restriction X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcus Folkesson , Marcel Patzlaff Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch removes the prefix restrictions on items in config files to compare and now allows any prefix to be used. Motivation: To the best of my knowledge, buildroot does not impose any restrictions on how to name config items. It is perfectly fine to use arbitrary prefixes in your extensions. This kind of freedom should be reflected in the accompanying tools so that's why I propose this patch. As a side effect, this script now is able to correctly compare configs of kconfig based packages as well as of buildroot itself. Signed-off-by: Marcel Patzlaff --- utils/diffconfig | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/utils/diffconfig b/utils/diffconfig index 5862a62f25..f1af23cfce 100755 --- a/utils/diffconfig +++ b/utils/diffconfig @@ -28,14 +28,14 @@ If no config files are specified, .config and .config.old are used. Example usage: $ diffconfig .config config-with-some-changes --LINUX_KERNEL_INTREE_DTS_NAME "vexpress-v2p-ca9" - LINUX_KERNEL_DTS_SUPPORT y -> n - LINUX_KERNEL_USE_INTREE_DTS y -> n - PACKAGE_DFU_UTIL n -> y - PACKAGE_LIBUSB n -> y - TARGET_GENERIC_HOSTNAME "buildroot" -> "Tuxie" - TARGET_GENERIC_ISSUE "Welcome to Buildroot" -> "Welcome to CustomBoard" -+PACKAGE_LIBUSB_COMPAT n +-BR2_LINUX_KERNEL_INTREE_DTS_NAME "vexpress-v2p-ca9" + BR2_LINUX_KERNEL_DTS_SUPPORT y -> n + BR2_LINUX_KERNEL_USE_INTREE_DTS y -> n + BR2_PACKAGE_DFU_UTIL n -> y + BR2_PACKAGE_LIBUSB n -> y + BR2_TARGET_GENERIC_HOSTNAME "buildroot" -> "Tuxie" + BR2_TARGET_GENERIC_ISSUE "Welcome to Buildroot" -> "Welcome to CustomBoard" ++BR2_PACKAGE_LIBUSB_COMPAT n """) sys.exit(0) @@ -44,12 +44,14 @@ Example usage: def readconfig(config_file): d = {} for line in config_file: - line = line[:-1] - if line[:4] == "BR2_": - name, val = line[4:].split("=", 1) - d[name] = val + line = line.strip() + if len(line) == 0: + continue if line[-11:] == " is not set": - d[line[6:-11]] = "n" + d[line[2:-11]] = "n" + elif line[0] != "#": + name, val = line.split("=", 1) + d[name] = val return d def print_config(op, config, value, new_value): @@ -58,9 +60,9 @@ def print_config(op, config, value, new_value): if merge_style: if new_value: if new_value=="n": - print("# BR2_%s is not set" % config) + print("# %s is not set" % config) else: - print("BR2_%s=%s" % (config, new_value)) + print("%s=%s" % (config, new_value)) else: if op=="-": print("-%s %s" % (config, value))