Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] deprecated.bbclass: Add a PNDEPRECATED variable for recipes
@ 2017-02-24  4:00 Joe MacDonald
  2017-02-24  4:55 ` Khem Raj
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Joe MacDonald @ 2017-02-24  4:00 UTC (permalink / raw)
  To: openembedded-core

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@mentor.com>
---

I threw this together a long time ago and never got around to sending it out for
consideration, but after the excitement last week and this, I got thinking about
it again and thought it might be useful.  My specific use-case for this is
recipes I see in meta-networking that I know are largely abandonware but that I
don't want to completely throw out without giving some kind of heads up.
Obviously this is purely informational, there's no mechanism set up for purging
deprecated recipes, that's intended to be a maintainer activity, but the idea
would be that the maintainer would flag a recipe as deprecated (probably when
it's become more trouble than it seems to be worth) and thereafter users would
have fair warning that this thing is on notice.  If nobody speaks up within some
amount of time the maintainer considers reasonable (I'm thinking a Yocto release
cycle) then it's fair game to remove the recipe in question.

 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



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

end of thread, other threads:[~2017-03-03 13:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-24  4:00 [PATCH] deprecated.bbclass: Add a PNDEPRECATED variable for recipes Joe MacDonald
2017-02-24  4:55 ` Khem Raj
2017-02-24  9:16   ` Martin Jansa
2017-02-24 20:39     ` Philip Balister
2017-02-24 20:51       ` Martin Jansa
2017-02-27 13:50         ` Joe MacDonald
2017-02-24 15:30 ` [PATCH v2] " Joe MacDonald
2017-02-27 13:59 ` [PATCH v3] " Joe MacDonald
     [not found] ` <20170227183329.9748.13885@do.openembedded.org>
2017-02-27 20:06   ` ✗ patchtest: failure for deprecated.bbclass: Add a PNDEPRECATED variable for recipes (rev3) Joe MacDonald
2017-02-27 20:25     ` Leonardo Sandoval
2017-02-27 22:24       ` Joe MacDonald
2017-03-03 13:57 ` [PATCH v4] deprecated.bbclass: Add a PNDEPRECATED variable for recipes Joe MacDonald

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