Strongly type chroot suffix
Let's continue the discussion around this in an issue, so it is easier to follow
Caleb wrote a patchset to make suffix an explicit type, later submitted as !2252.
Today Caleb wrote in matrix:
@ollieparanoid: so I started looking into pmb cleanup again... Read your review on the Suffix type stuff (right at the bottom of https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230629-suffix-type-hint-v1-0-e92802ae20a8%40postmarketos.org%3E#%3CCU1D0K6SVET8.4EI0XUU9957H@pm-mail-aerc%3E). here's what I think is the right way to go:
- Rename the "Suffix" type to "Chroot" and have it represent the full path (fetching the work dir from a new global variable)
- Use Pythons "pathlib" object oriented Path type and provide a Chroot.path() function. This will let us write paths like (
chroot.path() / "etc/apk/repositories"
)- We can extend the chroot type in the future to abstract common operations and maybe encapsulate additional state
- We adopt the
pmb.core
namespace, making it strongly typed and "stable" (if not public). The "args" variable would be banned from here, and we would basically try to use it for the parts of pmbootstrap that might be useful externally.cc @longnoserob regarding pmbootstrap documentation/API stuff
cc @andrisas, who has been using pmbootstrap as api sort of for the inofficial gpmbootstrap