Nilesh Patra:
Hi Niels,Thanks a lot for such a detailed reply! :) [...]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
The entirety of `debhelper` is built around global state and the code has filled with weird warnings and hard errors that will be emitted in various special-cases.
I am not convinced the `libdebhelper-perl` is capable of properly cleaning its global state well enough to reliably work with `lintian`'s use cases (such as processing multiple packages in one invocation).
If you want to do this, you have to use process isolation (`fork`), `chdir` into the unpacked source root, and then invoke `Debian::Debhelper::Dh_Lib::get_compat_info`.
It will save you the dependency, but not much else from a complexity PoV. It might be better to move `dh_assisant` to `libdebhelper-perl`.
Best regards, Niels Best regards, Niels
OpenPGP_signature.asc
Description: OpenPGP digital signature

