Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] externalsrc: Use deltask API
Date: Wed, 18 Dec 2013 11:30:03 +0000	[thread overview]
Message-ID: <1387366203.6402.34.camel@ted> (raw)

Now we have deltask API, stop poking around bitbake internal variables.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index c759289..53c71cb 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -26,21 +26,6 @@
 
 SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch"
 
-def remove_tasks(tasks, deltasks, d):
-    for task in tasks:
-        deps = d.getVarFlag(task, "deps")
-        for preptask in deltasks:
-            if preptask in deps:
-                deps.remove(preptask)
-        d.setVarFlag(task, "deps", deps)
-    # Poking around bitbake internal variables is evil but there appears to be no better way :(
-    tasklist = d.getVar('__BBTASKS') or []
-    for task in deltasks:
-        d.delVarFlag(task, "task")
-        if task in tasklist:
-            tasklist.remove(task)
-    d.setVar('__BBTASKS', tasklist)
-
 python () {
     externalsrc = d.getVar('EXTERNALSRC', True)
     if externalsrc:
@@ -53,16 +38,16 @@ python () {
         d.setVar('SRC_URI', '')
 
         tasks = filter(lambda k: d.getVarFlag(k, "task"), d.keys())
-        covered = d.getVar("SRCTREECOVEREDTASKS", True).split()
 
         for task in tasks:
             if task.endswith("_setscene"):
                 # sstate is never going to work for external source trees, disable it
-                covered.append(task)
+                bb.build.deltask(task, d)
             else:
                 # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time
                 d.appendVarFlag(task, "lockfiles", "${S}/singletask.lock")
 
-        remove_tasks(tasks, covered, d)
+        for task in covered:
+            bb.build.deltask(task, d)
 }
 




             reply	other threads:[~2013-12-18 11:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 11:30 Richard Purdie [this message]
2013-12-20 18:24 ` [PATCH] externalsrc: Use deltask API Paul Barker
2013-12-21  9:01   ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387366203.6402.34.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox