Hi Niels, Thanks a lot for such a detailed reply! :)
On 01/05/26 10:08 pm, Niels Thykier wrote: > Nilesh Patra: > Note `debhelper` manages this with hard errors when its rules on the > compat front is violated, so there is no reason for `lintian` to add > tags for people using compat `14` in `debian/compat`. A nice-to-have > could be to pedantic level nudge people away from `debian/compat` > (towards either `X-DH-Compat` or `debhelper-compat (= X)`). > But I think most people have already jumped on the `debhelper-compat > (= X)` boat long ago, so it is probably not worth it (if that nudge does > not already exist). It does exist :) https://lintian.debian.org/tags/uses-debhelper-compat-file.html >>> Note: `lintian` can use `dh_assistant` to determine the compat level >>> instead of implementing the logic itself for checking various fields and >>> files (the `export DH_COMPAT` checks for `debian/rules` might still be >>> necessary). Though, this implies debhelper/13.15+ as a dependency for >>> it to recognize `X-DH-Compat`. >> >> What is the better field to use to detect compat level? Is it >> `declared-compat-level` or `active-compat-level`? > > For `lintian`'s case, you probably want `declared-compat-level`. That is > the compat version "declared" directly in the packaging files/metadata. > > The `active-compat-level` is the compat level used if you execute a > command in the current environment (that is, it takes things like the > `DH_COMPAT` environment variable into account. But that is unlikely to > be set nor mean anything for `lintian`). > >> Is there an option to get the value directly instead of json? (saves lintian >> some parsing) >> > > No. Though, last I checked `lintian` would also need the > `declared-compat-level-source` field that describes the "source" of the > compat level anyway. I forgot what for, but it used to be a piece of > information relevant to either a tag or decision somewhere. Got it. That said, thinking more about this, lintian would introduce a hard `Depends` on `debhelper` if we were to implement this. I'd like to avoid that. Since there is `libdebhelper-perl` already, would it be possible for you to provide some API to extract out this information programmatically? This would be better for lintian rather running commands by hand and parsing out the information. We sure do it for some things (like `file` and `readelf` for example) where there is no option, but for this particular scenario, it is probably better managed via `libdebhelper-perl`. Please do let me know. Thank you so much, Nilesh

