freebsd / portmaster

FreeBSD port management script without external databases or languages
80 stars 40 forks source link

Cleaning out stale ports that used to be depended on does not work #77

Closed JulienDlq closed 1 year ago

JulienDlq commented 1 year ago
# portmaster -yDs
Usage: pkg query -e <evaluation> <query-format>
'-e' flag do not accept any other argument

This happens in this part of the code: https://github.com/freebsd/portmaster/blob/f273c9160333911ba1c7be3611a6cd34aefd3816/portmaster#L2073

If I try removing -a, it seems to work but I’m not fully sure if it does not have a bad side effect…

koron commented 1 year ago

pkg 1.19.0 changes to exclude other options for query.

https://github.com/freebsd/pkg/blame/ffdb473e704a48abca70446a5f025aba2eec8ca8/src/query.c#L955

stesser commented 1 year ago

That change to pkg-1.19.0 (commit cacd3d72988ff) was wrong, since some parameters can be used with "-e". It did break "make check-conflicts" in the ports framework, too, and it should therefore be reverted. A correct fix would check for invalid combinations of "-e" and other options instead of rejecting all other options. But since I had extensively tested combinations of "-e" with other options (e.g. "-xe" or "-ge"), there seems to have been a regression in the pkg query code that causes such combinations to fail now.

stesser commented 1 year ago

This issue has been fixed by removing "-a" from the affected pkg query command line as suggested in the report.

stesser commented 1 year ago

This issue has been fixed in portmaster, but the next release of the pkg command will also restore support for the combination of "-e" with other options that had been lost.