diff mbox series

[RFC] bitbake: allow -C to accept recipe1:task1,recipe2:task2

Message ID 20241006145526.64190-1-iuliuv@gmail.com
State New
Headers show
Series [RFC] bitbake: allow -C to accept recipe1:task1,recipe2:task2 | expand

Commit Message

Iuliu Vasilescu Oct. 6, 2024, 2:55 p.m. UTC
Previously a command such as:
bitbake -C fetch recipe1 recipe2
would invalidate fetch in both recipe1 and recipe2 before executing
the default task in both recipes. Finer control may be desired in
some situations.

With this change, a new format is accepted:
bitbake -C recipe1:fetch recipe1 recipe2

which invalidates fetch only in recipe1 than executes default task
in both recipe1 and recipe2. Only tasks in recipes presented in the
list are invalidated.

bitbake -C recipe3:fetch recipe1 recipe2

would not invalidate anything before executing recipe1 and recipe2.
This behavior is up for debate.
---
 doc/bitbake-user-manual/bitbake-user-manual-intro.rst | 9 ++++++---
 lib/bb/runqueue.py                                    | 5 +++++
 2 files changed, 11 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-intro.rst b/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
index 35ffb88b0..cce6097ea 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-intro.rst
@@ -373,9 +373,12 @@  Following is the usage and syntax for BitBake::
                            be 'compile' or 'populate_sysroot' or 'listtasks' may
                            give a list of the tasks available.
      -C INVALIDATE_STAMP, --clear-stamp=INVALIDATE_STAMP
-                           Invalidate the stamp for the specified task such as
-                           'compile' and then run the default task for the
-                           specified target(s).
+                           Invalidate the stamp for the specified taski(s) such
+                           as 'compile' and then run the default task for the
+                           specified target(s). A comma-separated task list is
+                           accepted. The tasks will be invalidated on all the
+                           targets, unless the tasks are specified as
+                           target:task.
      -r PREFILE, --read=PREFILE
                            Read the specified file before bitbake.conf.
      -R POSTFILE, --postread=POSTFILE
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 3462ed445..a9ead0d10 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -1251,6 +1251,11 @@  class RunQueueData:
             for tid in self.target_tids:
                 fn = fn_from_tid(tid)
                 for st in self.cooker.configuration.invalidate_stamp.split(','):
+                    if st.find(":") > 0:
+                        st_split = st.split(":");
+                        st = st_split[1]
+                        if fn.find(st_split[0]) < 0:
+                            continue
                     if not st.startswith("do_"):
                         st = "do_%s" % st
                     invalidate_task(fn + ":" + st, True)