sstatesig: Fix pn and taskname derivation in find_siginfo
PATCH RESEND v4 1/1 sstatesig: Fix pn and taskname derivation in find_siginfo
From: Yang Xu <[email protected]>
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>] by 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 and adds handling for multilib name.
And add test for compare_sigfiles and find_siginfo working together.
---
Notes:
v1: correct handling for pn and taskname for native target in find_siginfo
v2: add handling for multilib target in find_siginfo
v3: add testcase for compare_sigfiles and find_siginfo work together.
v4: optimize testcase to avoid non-deterministic fail
.../recipes-test/binutils/binutils_%.bbappend | 2 + meta/lib/oe/sstatesig.py | 17 ++-- meta/lib/oeqa/selftest/cases/sstatetests.py | 83 +++++++++++++++++++ 3 files changed, 97 insertions(+), 5 deletions(-) create mode 100644 meta-selftest/recipes-test/binutils/binutils_%.bbappend
meta-selftest/recipes-test/binutils/binutils_%.bbappend new file +2 -0
@@ -0,0 +1,2 @@ +# This bbappend is used to alter the recipe using the test_recipe.inc file created by tests. +include test_recipe.inc
meta/lib/oe/sstatesig.py +12 -5
@@ -321,11 +321,18 @@ 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:'): - pn = pn + '-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] + affixitems = affix.split(':') + if affixitems[0] == 'virtual': + if affixitems[1] == 'native': + pn = pn + '-native' + if affixitems[1] == 'multilib': + pn = affixitems[2] + '-' + pn hashfiles = {} filedates = {}
meta/lib/oeqa/selftest/cases/sstatetests.py +83 -0
86 lines not on this page · raw message
Signature · 1 line
2.18.0