mirror of
https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git
synced 2025-07-12 19:09:56 +03:00
pmb.chroot.apk: better error for mising apk-tools (MR 2388)
Currently the usr-merge script fails, and this leads to a very confusing error when running pmbootstrap the next time: (stack trace) KeyError: 'apk-tools' Show a more helpful error instead.
This commit is contained in:
parent
0109af5245
commit
f38d525538
1 changed files with 9 additions and 1 deletions
|
@ -24,6 +24,7 @@ import pmb.parse.version
|
|||
from pmb.core import Chroot
|
||||
from pmb.core.context import get_context
|
||||
from pmb.types import PathString
|
||||
from pmb.helpers.exceptions import NonBugError
|
||||
|
||||
|
||||
@Cache("chroot", "user_repository", mirrors_exclude=[])
|
||||
|
@ -89,8 +90,15 @@ def check_min_version(chroot: Chroot = Chroot.native()):
|
|||
)
|
||||
return
|
||||
|
||||
installed_pkgs = installed(chroot)
|
||||
|
||||
if "apk-tools" not in installed_pkgs:
|
||||
raise NonBugError(
|
||||
"ERROR: could not find apk-tools in chroot, run 'pmbootstrap zap' and try again"
|
||||
)
|
||||
|
||||
# Compare
|
||||
version_installed = installed(chroot)["apk-tools"]["version"]
|
||||
version_installed = installed_pkgs["apk-tools"]["version"]
|
||||
pmb.helpers.apk.check_outdated(
|
||||
version_installed,
|
||||
"Delete your http cache and zap all chroots, then try again:" " 'pmbootstrap zap -hc'",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue