#1098969 DebFile scripts ignore DEBIAN/templates file

Package:
python3-debian
Source:
python3-debian
Submitter:
Gabriel B. Sant'Anna
Date:
2026-02-25 19:29:02 UTC
Severity:
normal
Tags:
#1098969#5
Date:
2025-02-26 20:02:08 UTC
From:
To:
The `scripts` method in `debfile.DebFile` doesn't list templates
files, which might be required by config scripts.

Reproduction:
dict_keys(['postinst', 'postrm', 'config'])

The particular package is not important; this one just happens to
include a DEBIAN/templates file which is not being listed by the
scripts() method above.

Fixing this requires only appending 'templates' to the MAINT_SCRIPTS
array in src/debian/debfile.py, a change which doesn't cause any
regressions in the test suite.

Best regards,
Gabriel B. Sant'Anna

#1098969#10
Date:
2026-02-08 13:59:49 UTC
From:
To:
Control: tags -1 moreinfo

I believe the current behaviour is correct. Since `DEBIAN/templates` is
not a `maintscript`, it should not be included in `scripts()`. It is the
same reason why `DEBIAN/control` is also not present in that value.

If you want to see if the file is present,
`deb.control.has_file('templates')` would be the way to go about it.
Beyond that, `deb.control` also has accessors for the actual contents.

Best regards,
Niels

#1098969#17
Date:
2026-02-08 14:31:48 UTC
From:
To:
Resent, this time with the submitter included, so they also get the mail.

Niels Thykier:

#1098969#20
Date:
2026-02-08 14:31:48 UTC
From:
To:
Resent, this time with the submitter included, so they also get the mail.

Niels Thykier:

#1098969#25
Date:
2026-02-25 19:27:25 UTC
From:
To:
That's fair, although it could be argued that the templates file could also
be included since, when present, it's often needed by the main scripts.

From the Debian Policy (
https://www.debian.org/doc/debian-policy/ch-binary.html#s-maintscriptprompt
):
contain the additional package metadata files `config` and `templates`.
configuration, and `templates` contains templates used for user prompting.

Still, I think it's fine to keep this as it is, but it would be nice to
have this limitation documented in the API.