[1/2] archiver: check tasks exist before adding dependencies

Message ID 20180928134541.1370-1-ross.burton@intel.com
State Accepted
Commit 5c8aa1f41f04519a8ba3997c0d8e3a71fe270fae
Headers show
Series
  • [1/2] archiver: check tasks exist before adding dependencies
Related show

Commit Message

Ross Burton Sept. 28, 2018, 1:45 p.m.
Some recipes don't have do_configure, or have them but are marked as noexec.
Check for their existance before hooking up dependencies.

[ YOCTO #12868 ]

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/classes/archiver.bbclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 31c9b7eb4b6..7c3e701e704 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -98,9 +98,12 @@  python () {
 
         # There is a corner case with "gcc-source-${PV}" recipes, they don't have
         # the "do_configure" task, so we need to use "do_preconfigure"
-        if pn.startswith("gcc-source-"):
+        def hasTask(task):
+            return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
+
+        if hasTask("do_preconfigure"):
             d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn)
-        else:
+        elif hasTask("do_configure"):
             d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn)
         d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn)