diff mbox series

sstatesig: Fix pn and taskname derivation in find_siginfo

Message ID 20230628160146.11055-1-yang.xu@mediatek.com
State New
Headers show
Series sstatesig: Fix pn and taskname derivation in find_siginfo | expand

Commit Message

Yang Xu (徐扬) June 28, 2023, 4:01 p.m. UTC
From: Yang Xu <yang.xu@mediatek.com>

The `bb.siggen.compare_sigfiles` method transforms the key format from
`[mc:mc_name:][virtual:][native:]<recipe path>:<taskname>` to
`<recipe dir>/<recipe name>:<taskname>[:virtual][:native][:mc:mc_name]`
in `clean_basepaths`. However, `find_siginfo` uses the original format
to get the package name (pn) and task name. This commit corrects the
method for deriving the pn and task name in `find_siginfo`.

Signed-off-by: Yang Xu <yang.xu@mediatek.com>
---
 meta/lib/oe/sstatesig.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index f943df181e..a52dacd1a0 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -321,10 +321,13 @@  def find_siginfo(pn, taskname, taskhashlist, d):
     if not taskname:
         # We have to derive pn and taskname
         key = pn
-        splitit = key.split('.bb:')
-        taskname = splitit[1]
-        pn = os.path.basename(splitit[0]).split('_')[0]
-        if key.startswith('virtual:native:'):
+        if key.count(":") >= 2:
+            splitit,taskname,affix = key.split(":", 2)
+        else:
+            splitit,taskname = key.split(":", 1)
+            affix = ""
+        pn = os.path.splitext(os.path.basename(splitit))[0].split('_')[0]
+        if affix.startswith('virtual:native'):
             pn = pn + '-native'
 
     hashfiles = {}