projg2 / eclean-kernel

Installed kernel cleanup tool
GNU General Public License v2.0
32 stars 11 forks source link

Proposal: Preserve N most recent minor versions #15

Closed ironiridis closed 2 years ago

ironiridis commented 3 years ago

I'm willing to take a shot at a patch for this, but wanted to see if someone else had already been working on this.

For example, say you have the following kernels on disk: 5.11.16, 5.11.15, 5.11.14, 5.11.13, 5.11.12, 5.10.16, 5.10.15, 5.10.10, 5.9.14, 5.9.12, 4.20.5 (a subset of my actual current situation)

-n3 would remove all but 5.11.16, 5.11.15, 5.11.14 -N3 would remove all but 5.11.16, 5.10.16, 5.9.14 -n3 -N3 would remove all but 5.11.16, 5.11.15, 5.11.14, 5.10.16, 5.9.14

Thoughts?

ironiridis commented 2 years ago

I've taken a couple stabs at this, but the argument proposal is not straightforward to plumb into the VersionSort implementation and I'm not satisfied with the results of it. Plus I write terrible python.