Acknowledgement sent
to Gioele Barabucci <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Lintian Maintainers <[email protected]>.
(Mon, 20 Feb 2023 11:27:04 GMT) (full text, mbox, link).
Subject: lintian: d/rules: should suggest using
`execute_before/_after_dh_command` instead of `override_dh_command`
Date: Mon, 20 Feb 2023 12:24:10 +0100
Package: lintian
Version: 2.116.3
Severity: wishlist
Lintian should warn about the use of `override_dh_command` to inject
commands before or after the execution of `dh_command`. In such
situations one should use `execute_before_dh_command` and
`execute_after_dh_command`.
Many debian/rules files use `override_dh_command` to inject commands
before or after the execution of the default dh_command. For example:
override_dh_clean:
dh_clean:
touch this_strange_file
Since debhelper 12.8 (compat 10, Debian 11) one should use the more
expressive `execute_before_dh_command` and `execute_after_dh_command`.
For example:
execute_after_dh_clean:
touch this_strange_file
Real-life examples of such uses of `override_dh_command`:
https://salsa.debian.org/debian/pkg-collectd/-/blob/694f2c9/debian/rules#L278-310
In addition to simplifying the code of `d/rules` and making it more
expressive, the use of `execute_before/_after` ensures that all
dh_command-specific BUILD_OPTIONS-/BUILD_PROFILE-related actions are
taken into account without having to reimplement them inside
`override_dh_command`.
Regards,
--
Gioele Barabucci
Subject: Re: Bug#1031679: lintian: d/rules: should suggest using
`execute_before/_after_dh_command` instead of `override_dh_command`
Date: Mon, 20 Feb 2023 15:48:00 +0100
Re: Gioele Barabucci
> execute_after_dh_clean:
> touch this_strange_file
The downside of this is that it makes backporting to buster-and-older
harder since it doesn't have the required debhelper version yet.
Christoph
Acknowledgement sent
to Jelmer Vernooij <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Lintian Maintainers <[email protected]>.
(Mon, 20 Feb 2023 14:57:02 GMT) (full text, mbox, link).
Subject: Re: Bug#1031679: lintian: d/rules: should suggest using
`execute_before/_after_dh_command` instead of `override_dh_command`
Date: Mon, 20 Feb 2023 14:54:25 +0000
On Mon, Feb 20, 2023 at 03:48:00PM +0100, Christoph Berg wrote:
> Re: Gioele Barabucci
> > execute_after_dh_clean:
> > touch this_strange_file
>
> The downside of this is that it makes backporting to buster-and-older
> harder since it doesn't have the required debhelper version yet.
It might make sense to only give this warning for packages that are
already on >= 13?
Jelmer
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.