summaryrefslogtreecommitdiff
path: root/debian/apt.auto-removal.sh
Commit message (Collapse)AuthorAgeFilesLines
* Determine autoremovable kernels at run-timeJulian Andres Klode2021-01-041-68/+1
| | | | | | | | | | | | | | | | | | | | | | | Our kernel autoremoval helper script protects the currently booted kernel, but it only runs whenever we install or remove a kernel, causing it to protect the kernel that was booted at that point in time, which is not necessarily the same kernel as the one that is running right now. Reimplement the logic in C++ such that we can calculate it at run-time: Provide a function to produce a regular expression that matches all kernels that need protecting, and by changing the default root set function in the DepCache to make use of that expression. Note that the code groups the kernels by versions as before, and then marks all kernel packages with the same version. This optimized version inserts a virtual package $kernel into the cache when building it to avoid having to iterate over all packages in the cache to find the installed ones, significantly improving performance at a minor cost when building the cache. LP: #1615381
* auto-removal: Ignore running kernel if attempting a reproducible buildChris Lamb2017-03-131-1/+6
| | | | | | | | | If one is attempting to create a reproducible ISO image we do not want to include the build system's kernel version, not only due to it breaking reproducibility, but it could be somewhat misleading and/or the wrong thing to put in this file anyway. Closes: #857632
* Lower-case uname -r output in kernel autoremove helperJulian Andres Klode2016-08-261-1/+1
| | | | | This is needed on FreeBSD which has versions like 11.0-RC1, otherwise the tests would fail.
* Add kernels with "+" in the package name to APT::NeverAutoRemoveAndrew Patterson2016-07-081-1/+1
| | | | | | | | | Escape "+" in kernel package names when generating APT::NeverAutoRemove list so it is not treated as a regular expression meta-character. [Changed by David Kalnischkies: let test actually test the change] Closes: #830159
* debian/apt.auto-removal.sh: Adjust -dbg exclusion for multi-archJulian Andres Klode2015-12-141-2/+1
| | | | Allow an optional colon followed by anything at the end.
* tests: try to support spaces in TMPDIRDavid Kalnischkies2015-09-141-1/+1
| | | | | | | | Not all tests work yet, most notable the cdrom tests, but those require changes in libapt itself to have a proper fix and what we have fixed so far is good enough progress for now. Git-Dch: Ignore
* include debug information in the autoremove-kernels fileDavid Kalnischkies2015-09-141-3/+23
| | | | | | | | Figuring out after the fact what went wrong in the kernel hook is kinda hart, also as the bugreports are usually very lacking on the details front. Collecting the internal variables in the debug output we attach to the generated file might help shine some light on the matter. It's at least not going to hurt…
* select kernels to protect from autoremove based on Debian versionDavid Kalnischkies2015-09-141-50/+24
| | | | | | | | | | | | | | | | | | This is basically a rewrite of the script with the general idea of finding the Debian version of the installed kernels – as multiple flavours will have the same Debian version – select the two newest of them and translate them back to versions found in package names. This way we avoid e.g. kernel and kernel-rt to use up the protected slots even through they are basically the same kernel (just a different flavour) so it is likely that if kernel doesn't work for some reason, kernel-rt will not either. This also deals with foreign kernel packages, kernels on hold and partly installed kernels (in case multiple kernels are installed in the same apt run) in a hopefully sensible way. Closes: 787827
* tighten filtering of kernel images in apt.auto-removalJames McCoy2014-12-231-1/+1
| | | | | | | | | | | | | | | | | | | The current filtering matches the names of the image metapackages on the i386 architecture: $ dpkg-query -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]/ && $2 !~ /-dbg$/ { print $2 }' linux-image-3.16.0-4-586 linux-image-586 This results in an extra image package being removed from APT::NeverAutoRemove, losing the intended effect of keeping the {current, previous, latest} set of images installed. Requiring a “.” in the package name tightens the matched package names to those that are installing a specific version of the image, thus eliding the meta-packages. Closes: 772732
* only consider versioned kernel packages in autoremoveDavid Kalnischkies2014-03-211-1/+1
| | | | | | | | | | | | Metapackages like "linux-image-amd64" are otherwise matched by our extraction as well, which later on can't be successfully compared via dpkg --compare-versions as the 'amd64' bit isn't a version number. (Luckily none of our architectures starts with a digit.) This was broken by me in 0.9.16 as I moved a shell-glob matcher to a regex-based one which has slightly different semantics regarding '*'. Closes: 741962
* ensure that a dot is a dot in the hookDavid Kalnischkies2014-03-131-5/+2
| | | | | | As we deal with regex matchers here the dots are treated as wildcards if we don't take care of escaping them. Not very likely that this could be a real-world problem, but just to be sure.
* support kfreebsd and hurd in the kernel hookDavid Kalnischkies2014-03-131-11/+5
| | | | | | kfreebsd as well as hurd kernel packages call the postinst script as well so we just need to enable the correct parsing for installed packages and disable the "protect every version" hammer for them.
* use a configurable list of versioned kernel packagesDavid Kalnischkies2014-03-131-10/+11
| | | | | | With APT::VersionedKernelPackages users have the option of adding packages like pre-build out-of-tree modules to the list of automatically protected from being autoremoved.
* debian/apt.auto-removal.sh:Michael Vogt2013-07-231-1/+1
| | | | | | * debian/apt.auto-removal.sh: - do not include debug symbol packages for the kernel in the blacklist (closes: #717616)
* debian/apt.auto-removal.sh: merge the remaining bitsMichael Vogt2013-07-111-3/+3
|
* * Fix up two things in debian/apt.auto-removal.sh:Adam Conrad2013-07-111-3/+4
| | | | | | | | | | - Use exact matches with $-terminated regexes, so we don't get confusion between similarly-named kernel flavours. - Keep linux-backports-modules in sync with installed kernels. Conflicts: configure.in debian/changelog doc/apt-verbatim.ent
* get dpkg from apt-config as well and add robustness against missing/failing ↵Michael Vogt2013-07-111-3/+10
| | | | | | | apt-config (for paranoia) Conflicts: debian/apt.auto-removal.sh
* Make sure we always have at least two kernels marked not for removalSteve Langasek2013-07-111-0/+18
|
* cherry pick 39a07ec8f2c612a5af234c7713571362f7ca90b4Steve Langasek2013-07-111-0/+67