vmware / tdnf

Tiny Dandified Yum
Other
116 stars 49 forks source link

tdnf installonly_limit implementation behavioral parity with DNF #460

Open eric-desrochers opened 11 months ago

eric-desrochers commented 11 months ago

Is your feature request related to a problem? Please describe.

TDNF is removing package by least recent installation, while DNF is by lower package version. https://github.com/oliverkurth/tdnf/blob/8c73a0e825e5e14496c30a3ccfb829aeaf019749/client/goal.c#L1104-L1105

Example showing the behavior discrepancy between TDNF and DNF: image

Describe the solution you'd like

It would be optimal to be in parity with DNF to that regards.

Describe alternatives you've considered

n/a

Additional context

n/a

oliverkurth commented 11 months ago

When I implemented this I thought least recent would make most sense. We could add an option to control this behavior. Does dnf have such an option?

BTW, feel free to submit a PR. Currently, this feature is not used by Photon.

eric-desrochers commented 11 months ago

https://dnf.readthedocs.io/en/latest/command_ref.html image

eric-desrochers commented 11 months ago

Seems like TDNF is leveraged by libsolv. Maybe there is an existing option in libsolv that does that instead of SOLVER_ERASE ? https://github.com/openSUSE/libsolv/blob/master/doc/libsolv-bindings.txt

oliverkurth commented 11 months ago

Seems like TDNF is leveraged by libsolv. Maybe there is an existing option in libsolv that does that instead of SOLVER_ERASE

No, AFAIK this needs to be done in tdnf. libsolv just has an option to make it possible to install multiple versions (SOLVER_MULTIVERSION). When I researched this I found that zypper (SuSE's package manager) has a different logic for removing older versions.

Thanks for pointing out the --oldinstallonly option, that maybe useful for tdnf as well.

eric-desrochers commented 1 day ago

@oliverkurth any update on this behavioral gap between DNF and TDNF in the package removal logic after hitting the install limit ?

oliverkurth commented 23 hours ago

No update. But feel free to submit a PR.