[OE-core] [PATCH v4] deprecated.bbclass: Add a PNDEPRECATED variable for recipes
Joe MacDonald
joe_macdonald at mentor.com
Fri Mar 3 13:57:24 UTC 2017
Based on the blacklist behaviour, recipes can be tagged as deprecated.
Such recipes will produce a warning message when included in a build but
unlike blacklisted recipes, the build will continue.
Signed-off-by: Joe MacDonald <joe_macdonald at mentor.com>
---
Literally no different than v1, differs from v3 in that the doccumentation for
PNDEPRECATED has been removed again, since updates to documentation have to go
to a different list.
meta/classes/deprecated.bbclass | 16 ++++++++++++++++
meta/conf/distro/defaultsetup.conf | 3 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
create mode 100644 meta/classes/deprecated.bbclass
diff --git a/meta/classes/deprecated.bbclass b/meta/classes/deprecated.bbclass
new file mode 100644
index 0000000..3dcdadb
--- /dev/null
+++ b/meta/classes/deprecated.bbclass
@@ -0,0 +1,16 @@
+# To use the deprecated recipe check, a distribution should
+# include this class in the INHERIT_DISTRO
+#
+# Features:
+#
+# * To add a package to the deprecated list, set:
+# PNDEPRECATED[pn] = "message"
+#
+
+addtask check_deprecated before do_fetch
+python do_check_deprecated () {
+ deprecated = d.getVarFlag('PNDEPRECATED', d.getVar('PN', True), False)
+
+ if deprecated:
+ bb.warn("Recipe is deprecated: ", (deprecated))
+}
diff --git a/meta/conf/distro/defaultsetup.conf b/meta/conf/distro/defaultsetup.conf
index ca2f917..16ece3a 100644
--- a/meta/conf/distro/defaultsetup.conf
+++ b/meta/conf/distro/defaultsetup.conf
@@ -20,5 +20,6 @@ CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE'
USER_CLASSES ?= ""
PACKAGE_CLASSES ?= "package_ipk"
INHERIT_BLACKLIST = "blacklist"
+INHERIT_DEPRECATED = "deprecated"
INHERIT_DISTRO ?= "debian devshell sstate license remove-libtool"
-INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST} ${INHERIT_DEPRECATED}"
--
1.9.1
More information about the Openembedded-core
mailing list