~postmarketos/pmbootstrap

1020ea1a8b0c30bec57d038f19a08ad21455e6c2 — Clayton Craft 9 months ago a84dc5c
pmb.install: add --zap option

I zap chroots a lot, since I've found that it often "fixes" a lot of
weird issues that come about if you have stale chroots laying around.
So a common pattern I do is "pmb zap && pmb install ...". Having an
option to pmb install let's me simplify this.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231214234051.4673-1-clayton@craftyguy.net%3E
2 files changed, 5 insertions(+), 0 deletions(-)

M pmb/install/_install.py
M pmb/parse/arguments.py
M pmb/install/_install.py => pmb/install/_install.py +3 -0
@@ 1227,6 1227,9 @@ def install(args):
    else:
        steps = 4

    if args.zap:
        pmb.chroot.zap(args, False)

    # Install required programs in native chroot
    step = 1
    logging.info(f"*** ({step}/{steps}) PREPARE NATIVE CHROOT ***")

M pmb/parse/arguments.py => pmb/parse/arguments.py +2 -0
@@ 81,6 81,8 @@ def arguments_install(subparser):
                     " important password!")
    ret.add_argument("--no-cgpt", help="do not use cgpt partition table",
                     dest="install_cgpt", action="store_false", default=True)
    ret.add_argument("--zap", help="zap chroots before installing",
                     action="store_true")

    # Image type
    group_desc = ret.add_argument_group(