On Samstag, 16. Dezember 2023 19:58:17 CET Clayton Craft wrote:
> given how often people report issues in chat related to having stale
> chroots, I would actually prefer if zap were done by default when
> running pmb install...
Maybe let's do that then by default? Not sure if there's any use case that
would break, worst case we could add pmbootstrap install --no-zap?
>
> On Sat, Dec 16 2023 at 10:54:58 +01:00:00, Luca Weiss <luca@z3ntu.xyz>
>
> wrote:
> > On Freitag, 15. Dezember 2023 00:40:51 CET Clayton Craft wrote:
> >> 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.
> >
> > Tbh not super convinced by this since it is as easy as the example
> > command you
> > put there in the message. There's already many many options for
> > pmbootstrap so
> > adding more isn't my favorite thing.
> >
> > But if Ollie's fine, fine with me also.
> >
> > Regards
> > Luca
> >
> >> ---
> >>
> >> pmb/install/_install.py | 3 +++
> >> pmb/parse/arguments.py | 2 ++
> >> 2 files changed, 5 insertions(+)
> >>
> >> diff --git a/pmb/install/_install.py b/pmb/install/_install.py
> >> index 1adfe789..2f8e6e6a 100644
> >> --- a/pmb/install/_install.py
> >> +++ b/pmb/install/_install.py
> >>
> >> @@ -1170,6 +1170,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 ***")
> >>
> >> diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py
> >> index ffd8780c..b38d9cec 100644
> >> --- a/pmb/parse/arguments.py
> >> +++ b/pmb/parse/arguments.py
> >>
> >> @@ -135,6 +135,8 @@ def arguments_install(subparser):
> >> group.add_argument("--iter-time", help="cryptsetup iteration
> >>
> >> time (in"
> >>
> >> " milliseconds) to use when encrypting the
> >>
> >> system"
> >>
> >> " partition")
> >>
> >> + group.add_argument("--zap", help="zap chroots before
> >>
> >> installing",
> >>
> >> + action="store_true")
> >>
> >> # Packages
> >> group = ret.add_argument_group(