#1075843 dh-make: Consider using `dh_assistant supported-compat-levels` for selecting the compat level

#1075843#5
Date:
2024-07-06 08:01:04 UTC
From:
To:
Hi,

It is now possible to ask `debhelper` about the highest stable compat
version via the `dh_assistant supported-compat-levels` command.

I think it would make sense for `dh-make` to use this command as a
suggestion about which compat level to use. An example could be:


``python
import subprocess

_HIGHEST_COMPAT_LEVEL = 13


def extract_dh_compat_level() -> int:
     try:
         output = subprocess.check_output(
             ["dh_assistant", "supported-compat-levels"],
             stderr=subprocess.DEVNULL,
         )
     except (FileNotFoundError, subprocess.CalledProcessError) as e:
	return _HIGHEST_COMPAT_LEVEL
     else:
         data = json.loads(output)
         compat_level = data.get("HIGHEST_STABLE_COMPAT_LEVEL")
	if compat_level is None \
           or int(compat_level) < _HIGHEST_COMPAT_LEVEL:
             return _HIGHEST_COMPAT_LEVEL
         return int(compat_level)
```
(note: written by hand directly in the email. Apologies for any typos)


The example code will automatically pick the highest known debhelper
compat level provided by either `dh_assistant` or `dh_make`, where the
two disagree. They might when running `dh_make` on a stable where
`dh_assistant` does not exist and even in the future for bleeding edge
stuff.

Anyhow, just a suggestion if you want `dh_make` to automatically pick up
the latest compat level when it is available on the system that
`dh_make` is run on. Arguments can be had for both the current behavior
and the suggested behavior; it is really a matter of a preference how
`dh_make` should work. Please see this email a heads up that the
functionality exist and for you to decide which behavior you want (if
you have not already decided long ago).

Best regards,
Niels

#1075843#10
Date:
2026-01-10 10:10:41 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.