Closed tonyskapunk closed 5 years ago
I have the fix in #65 examples with the fix in place:
Without keep
:
$ kthresher -d
INFO: Attempting to read /etc/kthresher.conf.
INFO: Options found: ['include'].
INFO: Valid setting found "include"
INFO: include = /etc/kthresher.d/*.conf
INFO: Attempting to read /etc/kthresher.d/kthresher.conf.
INFO: Options found: ['headers'].
INFO: Valid setting found "headers"
INFO: headers = True
INFO: Options: {'dry_run': True, 'headers': True, 'include': '/etc/kthresher.d/*.conf', 'keep': 1, 'verbose': False, 'purge': False}
INFO: ----- DRY RUN -----
INFO: Running kernel is linux-image-4.9.0-8-amd64 v[4.9.110-3+deb9u6]
INFO: Attempting to keep 1 kernel package(s)
INFO: Found 4 kernel image(s) installed and available for autoremoval
INFO: Pre-sorting: ['4.9.65-3+deb9u1', '4.9.88-1+deb9u1', '4.9.110-3+deb9u2', '4.9.65-3+deb9u2']
INFO: Post-sorting: ['4.9.65-3+deb9u1', '4.9.65-3+deb9u2', '4.9.88-1+deb9u1', '4.9.110-3+deb9u2']
INFO: Purging packages from version: 4.9.65-3+deb9u1
INFO: Purging: linux-image-4.9.0-4-amd64
INFO: Purging packages from version: 4.9.65-3+deb9u2
INFO: Purging: linux-image-4.9.0-5-amd64
INFO: Purging: linux-headers-4.9.0-5-amd64
INFO: Purging: linux-headers-4.9.0-5-common
INFO: Purging packages from version: 4.9.88-1+deb9u1
INFO: Purging: linux-image-4.9.0-6-amd64
INFO: Purging: linux-headers-4.9.0-6-amd64
INFO: Purging: linux-headers-4.9.0-6-common
With keep
$ kthresher -dk
INFO: Attempting to read /etc/kthresher.conf.
INFO: Options found: ['include'].
INFO: Valid setting found "include"
INFO: include = /etc/kthresher.d/*.conf
INFO: Attempting to read /etc/kthresher.d/kthresher.conf.
INFO: Options found: ['headers'].
INFO: Valid setting found "headers"
INFO: headers = True
INFO: Options: {'keep': 1, 'verbose': False, 'purge': False, 'include': '/etc/kthresher.d/*.conf', 'headers': True, 'dry_run': True}
INFO: ----- DRY RUN -----
INFO: Running kernel is linux-image-4.9.0-8-amd64 v[4.9.110-3+deb9u6]
INFO: Attempting to keep 1 kernel package(s)
INFO: Found 4 kernel image(s) installed and available for autoremoval
INFO: Pre-sorting: ['4.9.110-3+deb9u2', '4.9.65-3+deb9u1', '4.9.88-1+deb9u1', '4.9.65-3+deb9u2']
INFO: Post-sorting: ['4.9.65-3+deb9u1', '4.9.65-3+deb9u2', '4.9.88-1+deb9u1', '4.9.110-3+deb9u2']
INFO: Purging packages from version: 4.9.65-3+deb9u1
INFO: Purging: linux-image-4.9.0-4-amd64
INFO: Purging packages from version: 4.9.65-3+deb9u2
INFO: Purging: linux-image-4.9.0-5-amd64
INFO: Purging: linux-headers-4.9.0-5-amd64
INFO: Purging: linux-headers-4.9.0-5-common
INFO: Purging packages from version: 4.9.88-1+deb9u1
INFO: Purging: linux-image-4.9.0-6-amd64
INFO: Purging: linux-headers-4.9.0-6-amd64
INFO: Purging: linux-headers-4.9.0-6-common
Debian package maintainer @jkirk reported this inconsistency with the
keep
argument:Without keep:
--keep
defaults to1
if--keep
is not given, but defaults to0
if no value for--keep
is given.