Source: lintian-brush
Version: 0.114
Severity: important
X-Debbugs-Cc: codeh...@debian.org

Dear Maintainer,

Debian Janitor proposed this change to python-envparse:

https://salsa.debian.org/python-team/packages/python-envparse/-/commit/9e543cc28d054301040e211033857f2a5e5d3265

When applied, Salsa CI failed and, thanfully, prevented the modified
package being uploaded. The change of ordering triggered a bug in
dh-python (filed separately) which caused an error in the maintainer
scripts such that the built package not only would not install but also
prevented installation of the previous version of that package or any
other package.

Setting up python3-envparse (0.2.0-3+salsaci) ...
dpkg-query: package 'python3-envparse' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.
Traceback (most recent call last):
  File "/usr/bin/py3compile", line 319, in <module>
    main()
  File "/usr/bin/py3compile", line 298, in main
    compile(files, versions,
  File "/usr/bin/py3compile", line 183, in compile
    for fn, versions_to_compile in filter_files(files, e_patterns, versions):
  File "/usr/bin/py3compile", line 128, in filter_files
    for fpath in files:
  File "/usr/share/python3/debpython/files.py", line 71, in filter_public
    for fn in files:
  File "/usr/share/python3/debpython/files.py", line 53, in from_package
    raise Exception("cannot get content of %s" % package_name)
Exception: cannot get content of python3-envparse:amd64


The problem is that lintian-brush writes out the d.control block using
an *arbitary* ordering of fields within the block. Policy states that
the ordering of the *blocks* is significant but does not require any
specific ordering within the blocks. Convention, however, is that Source
is the first line in the first block and Package is the first line of
the subsequent blocks.

dh-python might not be the only tool in the archive which implements
code based on this convention.

It looks like lintian-brush is storing the fields of d.control in an
unordered type and then writing out the fields without respecting the
original order. Right or wrong, this is causing errors elsewhere.

The change itself happens as part of the cute-field support to fix the
case of field keys. This is a "pedantic" lintian flag, any fix for such
a flag must not break any package.

Changing the ordering of other fields (like Priority and Section) does
not appear to be a problem. However, most packages in the archive are
using an ordering that is set by the initial dh-make operation and
manual edits of d.control rarely change the ordering of fields.


-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.14.0-1-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Reply via email to