Mkp list command no longer machine readable; please add parsable output

Hi Everybody!
I’m sorry to see that this causes you trouble (although a certain degree of trouble was expected).
Some dramatic changes to the packaging manager had to be introduced to solve upgrade blockers for a few customers, namely this: Extension packages: Support different versions in distributed setups

This led to a lot of follow up fixes and changes in behavior, far more than is good for a stable version.
For instance: The concept that you might want to compare versions and decide which one is newer was completely unknown to the system.

It’s always tricky to change the commands if you don’t know how they are used (or meant to be used).
I’ve decided to add the --json flag to make it clear that we have one output format for machines, and one for humans. Bringing this to 2.1 would have required even more changes to the code, so I decided against it in favor of stability. I feel that in this case unfortunately we have no winning move left :frowning:

For what it’s worth, you can parse the output:
mkp list | grep "(active on this site)$" | cut -f1 -d' '
Whether that is a “reasonable way” is a matter of opinion, I’ll give you that. But I don’t think it’ll break.

If you are a power user of the package managers command line interface, I recommend you test the 2.2 version when it is in beta – that’s when changes are still fairly easy to make, in particular if something changed anyway.

The use case of scripted installations certainly should not be made more complicated than necessary.
In particular making the commands add and enable idempotent would probably help; but we’d have to make sure that we’re actually installing the identical package – not only one with the same name and version. I think we should fail if the content changed, but neither name nor version.

6 Likes