Bug#797108: init-system-helpers: deb-systemd-helper doesn't remove old links when changing WantedBy= at package upgrade

Christian Seiler christian at iwakd.de
Thu Aug 27 21:19:57 BST 2015


Package: init-system-helpers
Version: 1.23
Severity: normal
Tags: patch

Dear Maintainer,

if a package in version 1 had WantedBy=a.target and this is changed
to WantedBy=b.target in version 2 of that package, deb-systemd-helper
will properly create the links in b.target.wants/, but will not remove
the links in a.target.wants/. Same goes with changes in Alias= and
changes in Also=.

I've attached a patch to this bug report that fixes this.

Note that any additional links that were manually created by the
administrator will not be touched, only those that were created by
deb-systemd-helper in the first place. The only use case that is
not covered by this patch is if an administrator wanted to keep a
link that was auto-created (there is no way to distinguish them),
but that seems to be quite unlikely (and the administrator could
re-create it later - and it would then stay, even if the same
version of the package were to be installed again - only upgrades
will remove links).

I've also attached a trivial package in two versions to test this.
They change all 3 options (WantedBy=, Also= and Alias=) to test
everything at the same time. Just extract the source tarballs and
build the native packages if you want to test this.

Please change the commit message of the patch so that it reflects
the bug number it closes when you apply it to git.

Regards,
Christian

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.1.0-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages init-system-helpers depends on:
ii  perl-base  5.20.2-6

init-system-helpers recommends no packages.

init-system-helpers suggests no packages.

-- no debconf information

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-deb-systemd-helper-Remove-obsolete-links-on-package-.patch
Type: text/x-diff
Size: 2716 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150827/3a936869/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testpkg_42.tar.xz
Type: application/x-xz
Size: 2160 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150827/3a936869/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testpkg_43.tar.xz
Type: application/x-xz
Size: 2216 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150827/3a936869/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-systemd-maintainers/attachments/20150827/3a936869/attachment-0001.sig>


More information about the Pkg-systemd-maintainers mailing list