From patchwork Fri Dec 18 23:52:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 559134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id CEFFF1401DA for ; Sat, 19 Dec 2015 10:52:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 64D4B33FDD; Fri, 18 Dec 2015 23:52:41 +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 n4gcd94K2kQF; Fri, 18 Dec 2015 23:52:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id B4BB733ECB; Fri, 18 Dec 2015 23:52:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B10A11C1EA5 for ; Fri, 18 Dec 2015 23:52:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AD09C9617A for ; Fri, 18 Dec 2015 23:52:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jsnN5OoNBsfO for ; Fri, 18 Dec 2015 23:52:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by hemlock.osuosl.org (Postfix) with ESMTPS id B86C996172 for ; Fri, 18 Dec 2015 23:52:33 +0000 (UTC) Received: from localhost.localdomain (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Sat, 19 Dec 2015 00:52:06 +0100 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Sat, 19 Dec 2015 00:52:03 +0100 Message-ID: <1450482723-31514-1-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.6.4 MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Subject: [Buildroot] [PATCH] Config.in.legacy: document how to handle renaming choice options X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When a choice option is renamed, it is not possible to select the new option. Instead, the default for the new option should be set in the choice itself. So let's document this. While we're at it, also reformat the whitespace in the example so a tab is used at the appropriate place. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Cc: Martin Bark --- Config.in.legacy | 74 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/Config.in.legacy b/Config.in.legacy index e1ea06f..4d22527 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -16,39 +16,77 @@ # is informed at build-time about selected legacy options. # If there is an equivalent (set of) new symbols, these should be select'ed by # the old symbol for backwards compatibility. +# It is not possible to select an option that is part of a choice. In that +# case, the new option should use the old symbol as default. This requires a +# change outside of Config.in.legacy, and this should be clearly marked as such +# in a comment, so that removal of legacy options also include the removal of +# these external references. +# +# [Example: renaming a bool option that is part of a choice from FOO to BAR] +# original choice: +# choice +# prompt "Choose foobar" +# config BR2_FOO_1 +# bool "foobar 1" +# config BR2_FOO_2 +# bool "foobar 2" +# endchoice +# +# becomes: +# choice +# prompt "Choose foobar" +# default BR2_BAR_1 if BR2_FOO_1 # legacy +# default BR2_BAR_2 if BR2_FOO_2 # legacy +# config BR2_BAR_1 +# bool "foobar 1" +# config BR2_BAR_2 +# bool "foobar 2" +# endchoice +# +# and in Config.in.legacy: +# config BR2_FOO_1 +# bool "foobar 1 has been renamed" +# help +# +# # Note: BR2_FOO_1 is still referenced from package/foo/Config.in +# config BR2_FOO_2 +# bool "foobar 2 has been renamed" +# help +# +# # Note: BR2_FOO_2 is still referenced from package/foo/Config.in +# +# [End of example] # # For string options, it is not possible to directly select another symbol. In # this case, a hidden wrap bool option has to be added, that defaults to y if # the old string is not set at its default value. The wrap symbol should select # BR2_LEGACY. # If the original symbol has been renamed, the new symbol should use the value -# of the old symbol as default. This requires a change outside of -# Config.in.legacy, and this should be clearly marked as such below, so that -# removal of legacy options also include the removal of these external -# references. +# of the old symbol as default. Like for choice options, a comment should be +# added to flag that the symbol is still used in another file. # # [Example: renaming a string option from FOO to BAR] # original symbol: -# config BR2_FOO_STRING -# string "Some foo string" +# config BR2_FOO_STRING +# string "Some foo string" # # becomes: -# config BR2_BAR_STRING -# string "Some bar string" -# default BR2_FOO_STRING if BR2_FOO_STRING != "" # legacy +# config BR2_BAR_STRING +# string "Some bar string" +# default BR2_FOO_STRING if BR2_FOO_STRING != "" # legacy # # and in Config.in.legacy: -# config BR2_FOO_STRING -# string "The foo string has been renamed" -# help -# +# config BR2_FOO_STRING +# string "The foo string has been renamed" +# help +# # -# config BR2_FOO_STRING_WRAP -# bool -# default y if BR2_FOO_STRING != "" -# select BR2_LEGACY +# config BR2_FOO_STRING_WRAP +# bool +# default y if BR2_FOO_STRING != "" +# select BR2_LEGACY # -# # Note: BR2_FOO_STRING is still referenced from package/foo/Config.in +# # Note: BR2_FOO_STRING is still referenced from package/foo/Config.in # # [End of example]