All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] Config.in.legacy: add an option to get rid of all legacy at once
@ 2015-01-25 15:31 Arnout Vandecappelle
  2015-01-25 15:31 ` [Buildroot] [PATCH 2/2] *config: improve handling of BR2_LEGACY Arnout Vandecappelle
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2015-01-25 15:31 UTC (permalink / raw)
  To: buildroot

The new option BR2_SKIP_LEGACY completely disables the legacy handling,
which effectively removes all the legacy options from the .config.

This option will become particularly useful for the next commit, which
improves legacy handling for randconfig.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Config.in.legacy | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Config.in.legacy b/Config.in.legacy
index 69608c7..fbe0b88 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -52,6 +52,9 @@
 #
 # [End of example]
 
+# BR2_SKIP_LEGACY is defined at the end of the file: it looks nicer in the menu
+if !BR2_SKIP_LEGACY
+
 config BR2_LEGACY
 	bool
 	help
@@ -1186,3 +1189,15 @@ config BR2_BFIN_FLAT
 	select BR2_LEGACY
 
 endmenu
+
+endif # BR2_SKIP_LEGACY
+
+config BR2_SKIP_LEGACY
+	bool "Forget all legacy options"
+	help
+	  Remove all the legacy options from this configuration.
+
+	  Warning: if you upgrade buildroot in the future, you will no
+	  longer be warned of legacy options that have been removed. We
+	  therefore advise to use this option only temporarily to
+	  quickly get rid of all legacy options you still have.
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 2/2] *config: improve handling of BR2_LEGACY
  2015-01-25 15:31 [Buildroot] [PATCH 1/2] Config.in.legacy: add an option to get rid of all legacy at once Arnout Vandecappelle
@ 2015-01-25 15:31 ` Arnout Vandecappelle
  2015-04-08 20:34   ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2015-01-25 15:31 UTC (permalink / raw)
  To: buildroot

In 8a46d4bf1f the randpackageconfig and allpackageyesconfig were
extended with disabling all the legacy options, otherwise the resulting
config couldn't be built. However, that didn't work for randconfig and
allyesconfig.

This commit reverts 8a46d4bf1f and replaces it with a different
approach: skipping of the legacy config options is passed explicitly
through the environment variable SKIP_LEGACY, which forces
BR2_SKIP_LEGACY to y.

Note that it is necessary for BR2_SKIP_LEGACY to be user-visible,
otherwise it will not be taken into account by 'make oldconfig' and
you would be questioned about the legacy options. Also, because
randconfig may randomly turn this option off or on, it is necessary
to select it and not simply default to BR2_SKIP_LEGACY_FROM_ENV.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
I ran into a lot of corner cases while developing this, so it will
require testing!

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Config.in.legacy | 11 ++++++++++-
 Makefile         | 21 ++++++++-------------
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/Config.in.legacy b/Config.in.legacy
index fbe0b88..801315b 100644
--- a/Config.in.legacy
+++ b/Config.in.legacy
@@ -52,8 +52,17 @@
 #
 # [End of example]
 
+# Allow the non-interactive configurations (randconfig, allpackageyesconfig,
+# ...) to disable the legacy handling completely since it is not relevant.
+# Otherwise allpackageyesconfig will also select all legacy options which
+# means it cannot be built.
+config BR2_SKIP_LEGACY_FROM_ENV
+	bool
+	select BR2_SKIP_LEGACY
+	option env=SKIP_LEGACY
+
 # BR2_SKIP_LEGACY is defined at the end of the file: it looks nicer in the menu
-if !BR2_SKIP_LEGACY
+if !BR2_SKIP_LEGACY && !BR2_SKIP_LEGACY_FROM_ENV
 
 config BR2_LEGACY
 	bool
diff --git a/Makefile b/Makefile
index 6cee027..dd2b7b6 100644
--- a/Makefile
+++ b/Makefile
@@ -706,7 +706,8 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
 	BR2_CONFIG=$(BR2_CONFIG) \
-	BR2_EXTERNAL=$(BR2_EXTERNAL)
+	BR2_EXTERNAL=$(BR2_EXTERNAL) \
+	SKIP_LEGACY=
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
@@ -734,23 +735,20 @@ oldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 
 randconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --randconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
 
 allyesconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --allyesconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
 
 allnoconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --allnoconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
 
 randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@grep '^config BR2_PACKAGE_' Config.in.legacy | \
-		while read config pkg; do \
-		echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --randconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
@@ -758,10 +756,7 @@ randpackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@grep '^config BR2_PACKAGE_' Config.in.legacy | \
-		while read config pkg; do \
-		echo "# $$pkg is not set" >> $(CONFIG_DIR)/.config.nopkg; done
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --allyesconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
@@ -769,7 +764,7 @@ allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@$(COMMON_CONFIG_ENV) \
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
 		$< --allnoconfig $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH 2/2] *config: improve handling of BR2_LEGACY
  2015-01-25 15:31 ` [Buildroot] [PATCH 2/2] *config: improve handling of BR2_LEGACY Arnout Vandecappelle
@ 2015-04-08 20:34   ` Yann E. MORIN
  0 siblings, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2015-04-08 20:34 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2015-01-25 16:31 +0100, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> This commit reverts 8a46d4bf1f and replaces it with a different
> approach: skipping of the legacy config options is passed explicitly
> through the environment variable SKIP_LEGACY, which forces
> BR2_SKIP_LEGACY to y.
> 
> Note that it is necessary for BR2_SKIP_LEGACY to be user-visible,
> otherwise it will not be taken into account by 'make oldconfig' and
> you would be questioned about the legacy options. Also, because
> randconfig may randomly turn this option off or on, it is necessary
> to select it and not simply default to BR2_SKIP_LEGACY_FROM_ENV.

I was not very happy with a user-visible skip-legacy option, so I
respinned a version without it.

Care to have a look and see if it still addresses all your concerns?

Thanks for this initial spin! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-08 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-25 15:31 [Buildroot] [PATCH 1/2] Config.in.legacy: add an option to get rid of all legacy at once Arnout Vandecappelle
2015-01-25 15:31 ` [Buildroot] [PATCH 2/2] *config: improve handling of BR2_LEGACY Arnout Vandecappelle
2015-04-08 20:34   ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.