mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC] ptxd_make_world_common: optionally bailout on deprecated variable use
@ 2022-10-18 13:14 Ladislav Michl
  2022-10-28 14:44 ` [ptxdist] [APPLIED] " Michael Olbrich
  0 siblings, 1 reply; 2+ messages in thread
From: Ladislav Michl @ 2022-10-18 13:14 UTC (permalink / raw)
  To: ptxdist

From: Ladislav Michl <ladis@linux-mips.org>

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
 This is aimed as helper for those willing to remove deprecated
 variables.
 Most of them are gone now, but a few <PKG>_ENV is still there.
 You may use (regexp provided by Uwe Kleine-König)
   grep -rPe '(?<!_CONF|MAKE)_ENV(?![)_])'
 to look for them

 config/setup/Kconfig                  |  6 ++++++
 scripts/lib/ptxd_make_world_common.sh | 15 ++++++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/config/setup/Kconfig b/config/setup/Kconfig
index 0a7db1678..f1a31e792 100644
--- a/config/setup/Kconfig
+++ b/config/setup/Kconfig
@@ -304,6 +304,12 @@ config SETUP_CHECK_EXIT_ON_ERROR
 	  quite aggressive error checking. Don't turn this on until
 	  you know what you're doing.
 
+config SETUP_DEPRECATED_FATAL
+	bool "bailout on deprecated variable use"
+	help
+	  Terminate on deprecated variable use. Turn this on only
+          if you are going to hunt for deprecated variables.
+
 config SETUP_ICECC
 	bool "use icecc"
 	depends on !SETUP_CCACHE
diff --git a/scripts/lib/ptxd_make_world_common.sh b/scripts/lib/ptxd_make_world_common.sh
index db24af99f..f72221076 100644
--- a/scripts/lib/ptxd_make_world_common.sh
+++ b/scripts/lib/ptxd_make_world_common.sh
@@ -20,6 +20,15 @@ ptxd_make_world_init_deprecation_check() {
 	pkg_deprecated_compile_env
 	pkg_deprecated_makevars
 	)
+    local -a depname
+    depname=(
+	BUILDDIR
+	ENV
+	AUTOCONF
+	CMAKE
+	COMPILE_ENV
+	MAKEVARS
+	)
     local i
 
     for ((i = 0; i < ${#dep[@]}; i++)); do
@@ -28,8 +37,12 @@ ptxd_make_world_init_deprecation_check() {
 
 	[ -z "${val}" ] && continue
 
-	echo "${var}=\"${val}\""
+	echo "<PKG>_${depname[i]}: ${var}=\"${val}\""
 	echo
+
+	if [ "${PTXCONF_SETUP_DEPRECATED_FATAL}" = "y" ]; then
+	    ptxd_bailout "${FUNCNAME}: deprecated variable <PKG>_${depname[i]} detected!"
+	fi
     done
 
 }
-- 
2.32.0




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

end of thread, other threads:[~2022-10-28 14:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18 13:14 [ptxdist] [RFC] ptxd_make_world_common: optionally bailout on deprecated variable use Ladislav Michl
2022-10-28 14:44 ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox