All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: runqueue: Add support for <task>- syntax
Date: Tue, 15 Dec 2015 16:42:18 +0000	[thread overview]
Message-ID: <1450197738.13505.76.camel@linuxfoundation.org> (raw)

It can be useful to run all tasks up to but not including a specific task. The
main reason this was never added was the lack of a good syntax. This patch
uses the syntax <taskname>- to denote this behaviour which is simple, not 
invasive and fits what we need from good syntax IMO, hence we can add this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 878028a..ee06f0e 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -634,23 +634,33 @@ class RunQueueData:
 
             fnid = taskData.build_targets[targetid][0]
             fn = taskData.fn_index[fnid]
-            self.target_pairs.append((fn, target[1]))
+            task = target[1]
+            parents = False
+            if task.endswith('-'):
+                parents = True
+                task = task[:-1]
+
+            self.target_pairs.append((fn, task))
 
             if fnid in taskData.failed_fnids:
                 continue
 
-            if target[1] not in taskData.tasks_lookup[fnid]:
+            if task not in taskData.tasks_lookup[fnid]:
                 import difflib
-                close_matches = difflib.get_close_matches(target[1], taskData.tasks_lookup[fnid], cutoff=0.7)
+                close_matches = difflib.get_close_matches(task, taskData.tasks_lookup[fnid], cutoff=0.7)
                 if close_matches:
                     extra = ". Close matches:\n  %s" % "\n  ".join(close_matches)
                 else:
                     extra = ""
-                bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (target[1], target[0], extra))
-
-            listid = taskData.tasks_lookup[fnid][target[1]]
-
-            mark_active(listid, 1)
+                bb.msg.fatal("RunQueue", "Task %s does not exist for target %s%s" % (task, target[0], extra))
+  
+            # For tasks called "XXXX-", ony run their dependencies
+            listid = taskData.tasks_lookup[fnid][task]
+            if parents:
+                for i in self.runq_depends[listid]:
+                    mark_active(i, 1)
+            else:
+                mark_active(listid, 1)
 
         # Step C - Prune all inactive tasks
         #




                 reply	other threads:[~2015-12-15 16:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1450197738.13505.76.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.