check-version-mismatch.bbclass: avoid single '(' in version output

Avoid a single '(' in version. For example, we want to extract the
'2.30.31' instead of '2.30.31(2' for lvm2.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Chen Qi 2025-04-17 01:05:10 -07:00 committed by Khem Raj
parent 05def1ad00
commit 095d61d2e2
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -95,6 +95,8 @@ python do_package_check_version_mismatch() {
version = version[1:]
if version.endswith(")") and "(" not in version:
version = version[:-1]
if not version.endswith(")") and "(" in version:
version = version.split('(')[0]
# handle extra version info
version = version + match.group("extra") + match.group("extra2")
possible_versions.append(version)