Your message dated Sat, 14 Oct 2017 07:34:00 +0000
with message-id <[email protected]>
and subject line Bug#870768: fixed in debhelper 10.9.2
has caused the Debian Bug report #870768,
regarding debhelper: dh_systemd_enable generates maintscript code for all units 
despite --name parameter
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 [email protected]
immediately.)


-- 
870768: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870768
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: debhelper
Version: 10.2.5
Severity: normal
Tags: patch

Dear maintainer,

When a package ships multiple units, and it uses dh_systemd_enable with
the --name parameter, eg with:

  debian/pkg1.foo1.service
  debian/pkg1.foo2.service

And calling:

override_dh_systemd_enable:
  dh_systemd_enable --name=foo1 --no-enable
  dh_systemd_enable --name=foo2

All calls act on all units despite the --name parameter. When using
additional parameters, such as --no-enable, the second call for foo2
will also write the maintainer script's snippet for foo1, enabling it,
despite the earlier --no-enable.

If the caller further restricts the run by passing the filename as
unnamed argument, which is redundant given the name of the file, then
false positive warnings are emitted at build time:

[  91s] dh_systemd_enable --name=foo1 foo1.service
[  91s] dh_systemd_enable: Could not find "foo1.service" in the
/lib/systemd/system directory of pkg2. This could be a typo, or using
Also= with a service file from another package. Please check carefully
that this message is harmless.
[  91s] dh_systemd_enable: Cannot open(foo1.service) for extracting the
Also= line(s)

Only by further restricting the run by passing -p pkg1 then this
warnings do not appear, as the helper will not try to find the units in
pkg2. Again this is redundant information, given the file is named
after the package it is supposed to be installed to.

A small patch is attached inline to fix this by restricting the sets of
units the helper acts on when --name is passed. Please do double, nay
triple check my Perl/regex though :-)

Thanks!

-- 
Kind regards,
Luca Boccassi


From e024276a141cb0b308e0cac6d9004cd479eb7546 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <[email protected]>
Date: Fri, 4 Aug 2017 21:51:46 +0100
Subject: [PATCH] dh_systemd_enable: if --name is used act only on that unit

A possible use case when using --name is having multiple units:
  debian/pkg.foo1.service
  debian/pkg.foo2.service
and calling the helper twice:
  dh_systemd_enable --name=foo1 --no-enable
  dh_systemd_enable --name=foo2
in which case the snippets would be duplicated in the maintainer
scripts.
This becomes a bug when different parameters are used in each call,
eg: --no-enable, which gets overridden by generated code from the
second call and stealthly enabled against the wishes of the caller.
---
 dh_systemd_enable | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dh_systemd_enable b/dh_systemd_enable
index c06f3c0f..a2fe9e79 100755
--- a/dh_systemd_enable
+++ b/dh_systemd_enable
@@ -217,6 +217,18 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                @args = grep !/(^|\/)$x$/, @args;
        }
 
+       # If --name was used, act only on matching units. A typical use case is 
having
+       # multiple units per package named debian/pkg.foo1.service 
debian/pkg.foo2.service
+       # and calling the helper twice:
+       #   dh_systemd_enable --name=foo1 --no-enable
+       #   dh_systemd_enable --name=foo2
+       # in which case the snippets would be duplicated in the maintainer 
scripts without
+       # this filtering. This becomes a bug when different parameters are used 
in each
+       # call, eg: --no-enable, which gets overridden by generated code from 
the second call.
+       if (defined $dh{NAME}) {
+               @args = grep 
/(^|\/)$dh{NAME}\.(mount|path|service|socket|target|tmpfile)$/, @args;
+       }
+
        for my $name (@args) {
                my $base = basename($name);
 
-- 
2.11.0

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Source: debhelper
Source-Version: 10.9.2

We believe that the bug you reported is fixed in the latest version of
debhelper, 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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Niels Thykier <[email protected]> (supplier of updated debhelper 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 [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 14 Oct 2017 07:19:38 +0000
Source: debhelper
Binary: debhelper dh-systemd
Architecture: source
Version: 10.9.2
Distribution: unstable
Urgency: medium
Maintainer: Debhelper Maintainers <[email protected]>
Changed-By: Niels Thykier <[email protected]>
Description:
 debhelper  - helper programs for debian/rules
 dh-systemd - debhelper add-on to handle systemd unit files - transitional pack
Closes: 752521 857306 870768 876486 878325 878427 878460
Changes:
 debhelper (10.9.2) unstable; urgency=medium
 .
   [ Niels Thykier ]
   * dh_install: Defer the removal of --list-missing and
     --fail-missing until compat 12.
   * dh: Run the new dh_installsystemd helper by default in compat 11.
   * systemd.pm: Remove the sequence in compat 11.  It has been replaced
     by the new dh_installsystemd helper.
 .
   [ Lisandro Damián Nicanor Pérez Meyer ]
   * qmake.pm: Remove unnecessary "-nocache" parameter.
     (Closes: #878427, LP: #1206234)
 .
   [ Ville Skyttä ]
   * Fix a number of spelling mistakes.  (Closes: #878325)
 .
   [ Felipe Sateler ]
   * dh_installsystemd: New command (currently noop except when used in
     the experimental compat 11).  This new helper:
     - Generates postinst code for tmpfiles (now that dh_installinit
       does not).
     - Follows the naming convention for other built-in dh_* commands.
     - Replaces dh_systemd_enable and dh_systemd_start in compat 11
       and later.
     - Only acts on units with the name specified by "--name" when this
       option is given.
     (Closes: #752521, #857306, #870768, #876486)
   * dh_systemd_enable: Remove as obsolete in compat 11.
   * dh_systemd_start: Ditto.
 .
   [ Helmut Grohne ]
   * cmake.pm: Also supply PKGCONFIG_EXECUTABLE for obsolete
     UsePkgConfig.cmake.  (Closes: #878460)
Checksums-Sha1:
 96b3e21006aeafb9ac0081d00e3026b1e96faffd 1768 debhelper_10.9.2.dsc
 9c234dee929ee42b3e6813ba7e23fb2f2a38cfc5 424752 debhelper_10.9.2.tar.xz
 bc26abfcc0f4e39f85ab8169f6cb0b79a5b3d42f 4476 debhelper_10.9.2_source.buildinfo
Checksums-Sha256:
 e9b6618dfe1b5fd343aea73161b1cd1bb800187969b95baa0c23d7621cd2558c 1768 
debhelper_10.9.2.dsc
 510ba7c22d2fc3eace8f455e19ac2766fbbb90a0278e36a7c01f8dde3c1195ac 424752 
debhelper_10.9.2.tar.xz
 5f68ee78528e70c60e4d126f35808f9707958f4cc8f545c8f4a23c7051fab99b 4476 
debhelper_10.9.2_source.buildinfo
Files:
 6bdae4739e9f767f86e5452adf9cc45c 1768 devel optional debhelper_10.9.2.dsc
 4e1c45a0c416fd139f389b5cba9fdd3e 424752 devel optional debhelper_10.9.2.tar.xz
 c94eb1ebe6576c6c9b6ea4c0ca444e99 4476 devel optional 
debhelper_10.9.2_source.buildinfo

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

iQIzBAEBCAAdFiEEsxMaRR2/33ygW0GXBUu7n32AZEIFAlnhu2MACgkQBUu7n32A
ZEIYwg//ZLBsCuNmKMGSr3VX9DMnEmAZMnBsKrIdPU8WWmGfi2kcwPjYrgEkhMug
FR51jiEou8ub+tyGyIQsnDQe8RFKVDu24bTkOeipkaeIGIjqmfICCZnukQAMAcG7
e0BnuFZqrOlWPIaC0KtEhQJQalILK2Bijdv/Cb+6JbBoUN2w+OPeU2ITQ/1bOLBd
MkvzCwbzrfeooJ8uHqQaV+MMQA5IaXPvHnLUPqajRxIYOZuuZyqeBpl3UntqVpty
yat4U0UuFT6VmCCnuur1095mQU9ezMlwxSKsBp+g4y3FNTw1UVhK4fsEKpEouplR
E2glexx1Gfljw9ZNnSL1YKLELqC5DSVA3gWpj29Nhj77MQbCP9FRIaTlw9iufjF7
UgjvPW3rijy9OQyEJJXL4+AnyvNbPrEUZqFwV/i39ccKyfsFV5Bv2SqwybUDTvrq
96Lx7gVLTYzd3JjGUcsJB2Q3XjK178hUuWR9QM+F6b0VjGyKoEu7+r9OGwjSWwi3
o/Ec2HSYb4NrnHhqr0RpiZ+2zxxzp9KREh7IUzZ0WY3ykJDjp4gmxLHQFuunAO5m
M/toxjRxvEnw3G8WjQwIO7Gr+aDJwTz28kDIm3NEBJFzj022T+wWtAIlhjRsfjWn
c/WXWTM5U52yfEo0RnLK/jULTkjzXvB/Makmf6kkw72r2BMd2bg=
=+eGz
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to