1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00

pmb.parse.kconfig.check: fix crash when trying to flash Alpine kernels

This fixes a bug when trying to flash an Alpine kernel. The
aport doesn't exist in pmaports when `flasher/frontend.py` calls
`pmb.parse.kconfig.check`:

  File "/home/a/pmbootstrap/pmb/commands/flasher.py", line 43, in run
    kernel(
  File "/home/a/pmbootstrap/pmb/flasher/frontend.py", line 38, in kernel
    pmb.parse.kconfig.check(flavor, must_exist=False)
  File "/home/a/pmbootstrap/pmb/parse/kconfig.py", line 262, in check
    apkbuild = pmb.parse.apkbuild(aport / "APKBUILD")
                                  ~~~~~~^~~~~~~~~~~~
TypeError: unsupported operand type(s) for /: 'NoneType' and 'str'
This commit is contained in:
Clayton Craft 2025-05-14 10:34:06 -07:00
parent aebf99e988
commit 6a2c7d4345
No known key found for this signature in database
GPG key ID: 4A4CED6D7EDF950A

View file

@ -259,6 +259,11 @@ def check(
if must_exist:
raise e
return None
# No exception is thrown if the aport isn't found and must_exit=False,
# so just return
if aport is None and not must_exist:
return None
apkbuild = pmb.parse.apkbuild(aport / "APKBUILD")
pkgver = apkbuild["pkgver"]