[bitbake-devel] siggen: clean_basepath: remove recipe full path when virtual:xyz present

Submitted by Jean-Francois Dagenais on Aug. 20, 2020, 9:50 p.m. | Patch ID: 175493

Details

Message ID 20200820215000.30818-2-jeff.dagenais@gmail.com
State New
Headers show

Commit Message

Jean-Francois Dagenais Aug. 20, 2020, 9:50 p.m.
Before this fix, this example basepath (a):
virtual:native:/full/path/to/recipes-example/helloworld/helloworld_1.2.3.bb:do_compile
would get incorrectly "cleaned" into:
helloworld/helloworld_1.2.3.bb:do_compile:virtual:native:/full/path/to/recipes-example/helloworld/helloworld_1.2.3.bb

When searching backwards in `a` trying to isolate the 'virtual:xyz' to add
it to the end of the string, we need to consider `a` still has the recipe
path and taskname. So stoping the rsplit after only 1 split is not enough.
We want to reach the second ':' from the end.

This way, we obtain:
helloworld/helloworld_1.2.3.bb:do_compile:virtual:native

reviewed-by: Maxime Roussin-BĂ©langer <maxime.roussinbelanger@gmail.com>
Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com>
---
 lib/bb/siggen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/bb/siggen.py b/lib/bb/siggen.py
index 4c63b0ba..ad49d1e2 100644
--- a/lib/bb/siggen.py
+++ b/lib/bb/siggen.py
@@ -752,7 +752,7 @@  def clean_basepath(a):
         _, mc, a = a.split(":", 2)
     b = a.rsplit("/", 2)[1] + '/' + a.rsplit("/", 2)[2]
     if a.startswith("virtual:"):
-        b = b + ":" + a.rsplit(":", 1)[0]
+        b = b + ":" + a.rsplit(":", 2)[0]
     if mc:
         b = b + ":mc:" + mc
     return b