Kaynağa Gözat

pkg-generic: introduce helper function to check for a deprecated variable

This patch introduces a helper check-deprecated-variable, that throws an
error when a package defines a deprecated variable. This helps in detecting
transition errors when changing the buildroot infrastructures, and also
helps users that have created packages not part of mainline buildroot.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas De Schampheleire 11 yıl önce
ebeveyn
işleme
220a583eb1
1 değiştirilmiş dosya ile 15 ekleme ve 0 silme
  1. 15 0
      package/pkg-generic.mk

+ 15 - 0
package/pkg-generic.mk

@@ -263,6 +263,21 @@ be selected at a time. Please fix your configuration)
 endif
 endef
 
+################################################################################
+# check-deprecated-variable -- throw an error on deprecated variables
+#
+# argument 1 is the deprecated variable
+# argument 2 is the new variable to use
+#
+# example:
+#   $(eval $(call check-deprecated-variable,FOO_MAKE_OPT,FOO_MAKE_OPTS))
+################################################################################
+define check-deprecated-variable
+ifneq ($$(origin $(1)),undefined)
+$$(error Package error: use $(2) instead of $(1). Please fix your .mk file)
+endif
+endef
+
 ################################################################################
 # inner-generic-package -- generates the make targets needed to build a
 # generic package