[R-pkg-team] Bug#1111274: dh-r: Consider using dh_assistant active-compat-level instead of ad-hoc compat level detection
Niels Thykier
niels at thykier.net
Sat Aug 16 12:25:10 BST 2025
Package: dh-r
Severity: wishlist
X-Debbugs-Cc: niels at thykier.net
Hi,
Similar to https://bugs.debian.org/1091921 for routine update,
consider replacing the ad-hoc compat level detection (I noticed it in at
least dh-update-R) with `dh_assistant active-compat-level`.
It will produce JSON output like:
{
"active-compat-level": 13,
"declared-compat-level": 13,
"declared-compat-level-source": "Build-Depends: debhelper-compat (= 13)"
}
With `declared-compat-level` and possibly `declared-compat-level-source`
being what you are interested in. The `active-compat-level` also
accounts for the `DH_COMPAT` ENV variable, which will not be relevant in
your case (as that variable would only be used inside `d/rules`; not
outside it).
For packages without compat levels at all, the command still succeeds
but each affected attribute is then set to `null`.
More documentation at `man dh_assistant`.
You may also find `dh_assistant supported-compat-levels` relevant as it
provides you with information about compat levels. Such as the latest
stable one, or the minimum supported compat level for
`debhelper-compat (= X)` relations.
Best regards,
Niels
PS: The `perl-code` package provides a JSON parser via the `JSON::PP`
module, so a proper JSON parsing module will not require an extra
dependency.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/r-pkg-team/attachments/20250816/aae6516f/attachment.sig>
More information about the R-pkg-team
mailing list