better kernel version sorting
should now detect that 6.12.16 is newer than 6.6.74 for example
This commit is contained in:
parent
17fc601022
commit
bbe23b1549
@ -419,7 +419,8 @@ def pkg_upgrade():
|
||||
for sysfile in ['config', 'initramfs', 'System.map', 'vmlinuz', 'kernel']:
|
||||
match = sorted(
|
||||
[f for f in files if f.startswith(f'{sysfile}-')],
|
||||
reverse=True)
|
||||
reverse=True,
|
||||
key=lambda x: tuple(map(int, x.split('-')[1].split('.')[:3])))
|
||||
for f in match[keep_kernels:]:
|
||||
log.debug(f"Removing old kernel file {f}")
|
||||
os.remove(os.path.join(root, f))
|
||||
|
Loading…
x
Reference in New Issue
Block a user