[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#830159: marked as done (apt-get autoremove removes kernels with "+" in the package name)



Your message dated Fri, 08 Jul 2016 12:48:31 +0000
with message-id <E1bLVCp-0001Gt-67@franck.debian.org>
and subject line Bug#830159: fixed in apt 1.3~pre2
has caused the Debian Bug report #830159,
regarding apt-get autoremove removes kernels with "+" in the package name
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
830159: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=830159
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 1.2.11

When I run apt-get autoremove, apt will also remove kernels with a "+"
in the package name, e.g,

# apt-get -s autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  linux-image-3.14.69-2+hlinux1-amd64-hlinux
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Remv linux-image-3.14.69-2+hlinux1-amd64-hlinux [3.14.69-2+hlinux1]

This is due to the "+" character not being escaped in
/etc/apt/apt.conf.d//etc/apt/apt.conf.d/01autoremove-kernels:

# head /etc/apt/apt.conf.d/01autoremove-kernels 
// DO NOT EDIT! File autogenerated by apt.auto-removal.sh
APT::NeverAutoRemove
{
   "^linux-image-3\.14\.69-2+hlinux1-amd64-hlinux$";
   "^linux-image-4\.4\.11-2-amd64-hpelinux$";
   "^linux-image-4\.4-amd64-hpelinux$";
   "^linux-headers-3\.14\.69-2+hlinux1-amd64-hlinux$";
   "^linux-headers-4\.4\.11-2-amd64-hpelinux$";
   "^linux-headers-4\.4-amd64-hpelinux$";
   "^linux-image-extra-3\.14\.69-2+hlinux1-amd64-hlinux$"; 

The "+" character is being treated as a regexp meta-character instead
of as a literal.  These kernels are obviously from a variant Debian
distribution, but others may run into the same issue.

The 01autoremove-kernels is generated by
/etc/kernel/postinst.d/apt-auto-removal (source file
debian/apt.conf.autoremove). The following code from that file
generates the blacklist:

kernels="$( (echo "$1
$unamer"; for deb in $debkernels; do echo "$list" | awk "\$2 == \"$deb\" { print \$1; }"; done; ) \
   | sed -e 's#\.#\\.#g' -e '/^$/ d' | sort -u)"

The sed line is escaping "." characters, but not "+" characters (legal
in package names).

I have attached a patch that has a fix for this problem.

-- 
Andrew Patterson
Hewlett-Packard Enterprise
commit 4c851c0d9b8d04e6c6aa44d1d380e139f0c2f7af
Author: Andrew Patterson <andrew.patterson@hpe.com>
Date:   Wed Jul 6 13:40:16 2016 -0600

    Add kernels with "+" in the package name to APT::NeverAutoRemove
    
    Escape "+" in kernel package names when generating APT::NeverAutoRemove
    list so it is not treated as a regular expression meta-character.

diff --git a/debian/apt.auto-removal.sh b/debian/apt.auto-removal.sh
index e7e2ca0..608d950 100644
--- a/debian/apt.auto-removal.sh
+++ b/debian/apt.auto-removal.sh
@@ -38,7 +38,7 @@ $running_version
 $previous_version" | sort -u | sed -e '/^$/ d')"
 kernels="$( (echo "$1
 $unamer"; for deb in $debkernels; do echo "$list" | awk "\$2 == \"$deb\" { print \$1; }"; done; ) \
-   | sed -e 's#\.#\\.#g' -e '/^$/ d' | sort -u)"
+   | sed -e 's#\([\.\+]\)#\\\1#g' -e '/^$/ d' | sort -u)"
 
 generateconfig() {
 	cat <<EOF

--- End Message ---
--- Begin Message ---
Source: apt
Source-Version: 1.3~pre2

We believe that the bug you reported is fixed in the latest version of
apt, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 830159@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Andres Klode <jak@debian.org> (supplier of updated apt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 08 Jul 2016 14:28:57 +0200
Source: apt
Binary: apt libapt-pkg5.0 libapt-inst2.0 apt-doc libapt-pkg-dev libapt-pkg-doc apt-utils apt-transport-https
Architecture: source
Version: 1.3~pre2
Distribution: unstable
Urgency: medium
Maintainer: APT Development Team <deity@lists.debian.org>
Changed-By: Julian Andres Klode <jak@debian.org>
Description:
 apt        - commandline package manager
 apt-doc    - documentation for APT
 apt-transport-https - https download transport for APT
 apt-utils  - package management related utility programs
 libapt-inst2.0 - deb package format runtime library
 libapt-pkg-dev - development files for APT's libapt-pkg and libapt-inst
 libapt-pkg-doc - documentation for APT development
 libapt-pkg5.0 - package management runtime library
Closes: 830159
Changes:
 apt (1.3~pre2) unstable; urgency=medium
 .
   [ Andrew Patterson ]
   * Add kernels with "+" in the package name to APT::NeverAutoRemove
     (Closes: #830159)
 .
   [ David Kalnischkies ]
   * add Testsuite-Triggers to tagfile-order
   * tests: fix external solver/planner directory setup
Checksums-Sha1:
 609221a5c7686ec56c833ac8f8b2c1f5f55c06f6 2506 apt_1.3~pre2.dsc
 8c95ae3443aeac45bdea61f4ea453b3995272125 2080244 apt_1.3~pre2.tar.xz
Checksums-Sha256:
 15bc956cc595352c08b1effe055ab8a25ffd97834830fee6d17b9920684c58f7 2506 apt_1.3~pre2.dsc
 41a2fbdee63db834255324e2f3a49484953d6d27d305625a70f8d7c9a54fafa9 2080244 apt_1.3~pre2.tar.xz
Files:
 fae29fce268e64a63253f77fb410002d 2506 admin important apt_1.3~pre2.dsc
 e87f578278cb527e8a126ff08170eb3a 2080244 admin important apt_1.3~pre2.tar.xz

-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXf54yAAoJENc8OeVlgLOGwBEP/iUpAFmzaB88fqas9QAlOKIx
AVuu72ki6ba7JCPFZAP66M69RCdGr0FlMY1JXS+ExySKajhPBcJEklmma9Bx3MFE
EzSkWl/wzIA7rDZ3HV/1wF6wTccflcKdnNn2ttbCwAaTQZk9jDxAhH57DFuldzIz
hl6U1uCzGVKrRtYS6TIgkjG17EFnVUC3pyjByeAM38pv5i5GW0IA4Cy0SJAWnEoQ
jFfJTmy0sCjN4/3xNzDme0XNGrh5HDpXDHmHb6vHNJzClVaOdsIeQ3T82BDrv45N
Bo6MoNgNgj+z9HRxdh3COXqF9O760Chbe9qvD5LbbtMu4PwhNi5GvFhdqN6mGQaN
HXhLZIXdzubPwQ3OJ5Vmut0bAZApMWHHrx3ugSbRjfr1SZjyNgIfLu2OM4kyKnqz
aY8NqoXxiDu9DGcK2NgTKUFpEnBZAsfo7DAk2J2xoNHatJ4VMpF9xHn6675vCNie
zoOvwYrw8N8hegCc6hSif2J1K43o8nnpgpcKWadSbeinZn+IiEpFix1vgtTklnbF
B6zNNQdfx+jWKdKwgDz9CFHZ0I7AfhUyfWw3Tp+7w7Q9uzAHgej2bEIyy3SAkuvP
YMv6KTkwpI/Bg5dMeobVUCnbN+X1zPqCFFHaZkHL8BdbT1U8O42Ai0AJl60w2rJ3
1aR5S8T/jbZIytsVpTXA
=XFvt
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: