check-version-mismatch.bbclass: avoid meaningless checking

If users set CHECK_VERSION_PN for a recipe and its value is a single
'%', then it matches anything. So there's no point doing any further
check.

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:11 -07:00 committed by Khem Raj
parent 095d61d2e2
commit b1281d5bc8
No known key found for this signature in database
GPG Key ID: BB053355919D3314

View File

@ -207,6 +207,14 @@ python do_package_check_version_mismatch() {
os.makedirs(debug_directory, exist_ok=True)
data_lines.append("pv: %s\n" % pv)
# handle a special case: a pure % means matching all, no point in further checking
if pv == "%":
if enable_debug:
data_lines.append("FINAL RESULT: MATCH (%s matches all, skipped)\n\n" % pv)
with open(debug_data_file, "w") as f:
f.writelines(data_lines)
return
got_quick_match_result = False
# handle python3-xxx recipes quickly
__regex_python_module_version__ = re.compile(r"(?:^|.*:)Version: (?P<version>.*)$")