On Fri, 22 Sept 2023 at 15:37, Sam James <s...@gentoo.org> wrote:
>
>
> Alex Boag-Munroe <ni...@qap.la> writes:
>
> > Any reason for the parseable parts to not be in an established human
> > readable/editable format? e.g. the config ini style format, or TOML?
>
> The only issue really is that depending on how it's done (do we do
> it for the whole file, or just comments), it may need a new (profile)
> EAPI which will take a while to implement and deploy.
>
> If it's just for comments, then we can do it immediately though.
>
> >
> > To crib from the OP example with something configparser understands:
> > [PREAMBLE]
> > Timestamp: 2023-09-21 15:07:42+00:00
> > Author: Arthur Zamarin <arthur...@gentoo.org>
> > Justification: Very broken, no idea why packaged, need to drop ASAP.
> >     The project is done with supporting this package.
> > Bugs: 667687, 667689
> > Removal Date: 2023-10-21
> > Packages: dev-lang/python
> >
> > The format is well documented already and simple to check for
> > validity, so any GLEP would just need to cover correct keys/values.
> >
>
> But yeah, I agree it's worth thinking about a proper format rather than
> fragile text mangling going into the future.
>
Perhaps eventually it could/should be used for the whole file but as
an interim/beginning there's no reason you couldn't start with
comments:

# [PREAMBLE]
# Timestamp: 2023-09-21 15:07:42+00:00
# Author: Arthur Zamarin <arthur...@gentoo.org>
# Justification: Very broken, no idea why packaged, need to drop ASAP.
#     The project is done with supporting this package.
# Bugs: 667687, 667689
# Packages: dev-lang/python
dev-lang/python

This simply adds a pre parse step of stripping the comments then
feeding directly into configparser or probably more suitable, TOML
since TOML has better syntax for directly delivering things like a
"Packages:" key as a list.

Redoing a bunch of package.* parsing probably wasn't in scope of the
OP but I've always wondered and this felt an opportune moment to
ask/suggest :)

--
Ninpo

Reply via email to