#1012732 lintian: output-of-updaterc.d-not-redirected-to-dev-null only emitted for first update-rc.d call

#1012732#5
Date:
2022-06-13 01:26:24 UTC
From:
To:
While debugging test failures in t/recipes/checks/init-d/init.d-general,
I noticed the following unexpected change in emitted tags at commit
9e7db94ee5eadab0e6e7b4509abdea7c2087af31 (i.e. the 211th commit after
2.114.0):

I moved the #DEBHELPER# token in
t/recipes/checks/init-d/init.d-general/build-spec/debian/init.d-general-bugs.postinst
behind the additional update-rc.d call to hopefully get less often
changing line numbers after new debhelper releases (which was actually
the cause for the test failure):

diff --git a/t/recipes/checks/init-d/init.d-general/build-spec/debian/init.d-general-bugs.postinst b/t/recipes/checks/init-d/init.d-general/build-spec/debian/init.d-general-bugs.postinst
index e3bb515a1..d14ad23f9 100644
--- a/t/recipes/checks/init-d/init.d-general/build-spec/debian/init.d-general-bugs.postinst
+++ b/t/recipes/checks/init-d/init.d-general/build-spec/debian/init.d-general-bugs.postinst
@@ -2,9 +2,9 @@

 set -e

-#DEBHELPER#
-
 if [ "$1" = "configure" ] ; then
     # duplicate call as debhelper will add one for us
     update-rc.d init.d-general-bugs word
 fi
+
+#DEBHELPER#

And suddenly, lintian correctly emitted

  init.d-general-bugs (binary): output-of-updaterc.d-not-redirected-to-dev-null init.d-general-bugs [postinst:7]

which it didn't do beforehand but should have.

How to reproduce:

Checkout commit 9e7db94ee5eadab0e6e7b4509abdea7c2087af31, apply the
patch above and run

  private/runtests -o check:init-d

Lintian will show you the diff as follows:

  Failed test: t/recipes/checks/init-d/init.d-general
  -init.d-general-bugs (binary): duplicate-updaterc.d-calls-in-postinst init.d-general-bugs [postinst:17]
  +init.d-general-bugs (binary): output-of-updaterc.d-not-redirected-to-dev-null init.d-general-bugs [postinst:7]
  +init.d-general-bugs (binary): duplicate-updaterc.d-calls-in-postinst init.d-general-bugs [postinst:13]
  >>>  Fix test (y), accept all (a), do not fix (n), quit (q/default)?

Note that not just the line number changed as expected, but an
additional tag showed up.

#1012732#10
Date:
2026-01-10 10:08:19 UTC
From:
To:
Es gibt eine Familienspende in Höhe von 1.850.000,00 USD von Cheng Charlie
Saephan. Bitte antworten Sie für weitere Informationen. Denken Sie daran,
Ihrer Familie und den Bedürftigen in Ihrer Umgebung Gutes zu tun.

Dies ist bereits der zweite Versuch, Sie zu erreichen. Bitte antworten Sie
für weitere Details.