Bug#857194: Add check for obsolete systemd BindTo= option

Michael Biebl biebl at debian.org
Wed Mar 8 19:36:08 GMT 2017


Package: lintian
Version: 2.5.50.1
Severity: wishlist
Tags: patch

Hi,

while filing [1], I thought it might be a good idea to turn that into a
lintian check.

Please find attached patch for that.


Regards,
Michael


[1] https://bugs.debian.org/cgi-bin/pkgreport.cgi?users=pkg-systemd-maintainers@lists.alioth.debian.org;tag=obsolete-bind-to

-- System Information:
Debian Release: 9.0
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages lintian depends on:
ii  binutils                          2.28-2
ii  bzip2                             1.0.6-8.1
ii  diffstat                          1.61-1+b1
ii  file                              1:5.29-3
ii  gettext                           0.19.8.1-2
ii  intltool-debian                   0.35.0+20060710.4
ii  libapt-pkg-perl                   0.1.30
ii  libarchive-zip-perl               1.59-1
ii  libclass-accessor-perl            0.34-1
ii  libclone-perl                     0.38-2+b1
ii  libdigest-sha-perl                5.96-1+b1
ii  libdpkg-perl                      1.18.23
ii  libemail-valid-perl               1.202-1
ii  libfile-basedir-perl              0.07-1
ii  libipc-run-perl                   0.94-1
ii  liblist-moreutils-perl            0.416-1+b1
ii  libparse-debianchangelog-perl     1.2.0-12
ii  libperl5.24 [libdigest-sha-perl]  5.24.1-1
ii  libtext-levenshtein-perl          0.13-1
ii  libtimedate-perl                  2.3000-2
ii  liburi-perl                       1.71-1
ii  libyaml-libyaml-perl              0.63-2
ii  man-db                            2.7.6.1-2
ii  patchutils                        0.3.4-2
ii  perl                              5.24.1-1
ii  t1utils                           1.39-2
ii  xz-utils                          5.2.2-1.2+b1

Versions of packages lintian recommends:
ii  dpkg                                 1.18.23
ii  libautodie-perl                      2.29-2
ii  libperlio-gzip-perl                  0.19-1+b2
ii  perl                                 5.24.1-1
ii  perl-modules-5.24 [libautodie-perl]  5.24.1-1

Versions of packages lintian suggests:
pn  binutils-multiarch     <none>
ii  dpkg-dev               1.18.23
ii  libhtml-parser-perl    3.72-3
ii  libtext-template-perl  1.46-1

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/lintian/checks/systemd.desc (from lintian package)
debsums: changed file /usr/share/lintian/checks/systemd.pm (from lintian package)
-------------- next part --------------
>From d390729926ba5ae34fe2f7132ae7b10608f55ff1 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl at debian.org>
Date: Wed, 8 Mar 2017 20:26:21 +0100
Subject: [PATCH] c/systemd: Check for obsolete BindTo= option

The BindTo= option has been deprecated in favour of BindsTo= which
should be used instead.

See https://github.com/systemd/systemd/commit/7f2cddae09fd2579ae24434df577bb5e5a157d86
---
 checks/systemd.desc | 8 ++++++++
 checks/systemd.pm   | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/checks/systemd.desc b/checks/systemd.desc
index d4aea020a..0071c1a58 100644
--- a/checks/systemd.desc
+++ b/checks/systemd.desc
@@ -34,6 +34,14 @@ Info: The systemd service file refers to an obsolete target.
  example, declaring <tt>After=syslog.target</tt> is unnecessary by now because
  syslog is socket-activated and will therefore be started when needed.
 
+Tag: systemd-service-file-refers-to-obsolete-bindto
+Severity: normal
+Certainty: certain
+Info: The systemd service file refers to the obsolete BindTo= option.
+ .
+ The <tt>BindTo=</tt> option has been deprecated in favour of
+ <tt>BindsTo=</tt> which should be used instead.
+
 Tag: systemd-no-service-for-init-script
 Severity: serious
 Certainty: certain
diff --git a/checks/systemd.pm b/checks/systemd.pm
index a7ea9cd29..0b92e19ab 100644
--- a/checks/systemd.pm
+++ b/checks/systemd.pm
@@ -200,6 +200,9 @@ sub check_systemd_service_file {
     tag 'systemd-service-file-refers-to-obsolete-target', $file, $_
       for @obsolete;
 
+    tag 'systemd-service-file-refers-to-obsolete-bindto', $file,
+      if extract_service_file_values($file, 'Unit', 'BindTo');
+
     if (not $file->is_symlink or $file->link ne '/dev/null') {
         tag 'systemd-service-file-missing-documentation-key', $file,
           unless extract_service_file_values($file, 'Unit', 'Documentation',1);
-- 
2.11.0



More information about the Pkg-systemd-maintainers mailing list