Comment 10 for bug 1675079

Revision history for this message
Steve Langasek (vorlon) wrote :

Why does the update-manager upload include this code?:

+ running_kernel_version = subprocess.check_output(
+ ["uname", "-r"], universal_newlines=True).rstrip()
+ self.running_kernel_pkgs_regexp = re.compile("(" + "|".join(
+ [("^" + p + ".*" + running_kernel_version)
+ if not p.startswith(".*") else (running_kernel_version + p)
+ for p in apt_versioned_kernel_pkgs]) + ")")
[...]
+ if (pkg.is_auto_removable and
+ (cache.versioned_kernel_pkgs_regexp and
+ cache.versioned_kernel_pkgs_regexp.match(pkg.name) and
+ not cache.running_kernel_pkgs_regexp.match(pkg.name))):
+ kernel_autoremove_pkgs.append(pkg)
+ pkg.mark_delete()

apt already has an implementation in /etc/kernel/postinst.d/apt-auto-removal which ensures that the currently-running kernel is not autoremoved. Why are you duplicating this functionality in update-manager?