core: chroot: add .exists() method (MR 2252)

Add a method to determine if a chroot exists.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-12 19:38:05 +02:00 committed by Oliver Smith
parent e49fb064b5
commit 7d98605a92
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 6 additions and 2 deletions

View file

@ -115,7 +115,7 @@ def init(chroot: Chroot, usr_merge=UsrMerge.AUTO):
pmb.chroot.mount(chroot)
mark_in_chroot(chroot)
if (chroot / "bin/sh").is_symlink():
if chroot.exists():
pmb.config.workdir.chroot_check_channel(chroot)
copy_resolv_conf(chroot)
pmb.chroot.apk.update_repository_list(chroot)