kconfig check: extract_version: replace - with _

Replace the dash in rc kernels with an underscore, so the resulting
version of e.g. 6.1.0-rc3 becomes a valid alpine pkgver (6.1.0_rc3).
This is needed so pmbootstrap can properly parse and compare the
version.

Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-11-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2023-03-12 16:13:17 +01:00
parent f393bbdab1
commit 905ccbb840
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ def extract_version(config_path):
text = [next(f) for x in range(3)][2]
ver_match = re.match(r"# Linux/\S+ (\S+) Kernel Configuration", text)
if ver_match:
return ver_match.group(1)
return ver_match.group(1).replace("-", "_")
# No match
logging.info("WARNING: failed to extract version from kernel config")