forked from Mirror/pmbootstrap
pmb.core.chroot: add a chroot glob helper (MR 2252)
Add a static method to glob all the chroot directories that exist on the filesystem. Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
parent
233cbdadeb
commit
425b61f7db
1 changed files with 9 additions and 0 deletions
|
@ -152,3 +152,12 @@ class Chroot:
|
|||
yield f"chroot_{stype.value}"
|
||||
else:
|
||||
yield f"chroot_{stype.value}_*"
|
||||
|
||||
|
||||
@staticmethod
|
||||
def glob() -> Generator[Path, None, None]:
|
||||
"""
|
||||
Glob all initialized chroot directories
|
||||
"""
|
||||
for pattern in Chroot.iter_patterns():
|
||||
yield from Path(pmb.config.work).glob(pattern)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue