Skip to content

rules_deb produces invalid Files- and Checksum-sections #659

Closed
@msiebuhr

Description

@msiebuhr

Per https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-files, Files (and Checksum-XX)-sections must have the first line empty, ex:

Files:
 c6f698f19f2a2aa07dbb9bbda90a2754 571925 example_1.2.orig.tar.gz

Yet rules_deb produces:

Files: c6f698f19f2a2aa07dbb9bbda90a2754 571925 example_1.2.orig.tar.gz

The relevant code does try to do the right thing when generating the fields

MakeDebianControlField(
'Files', '\n ' + ' '.join(
[checksums['md5'], debsize, section, priority, deb_basename])),
MakeDebianControlField(
'Checksums-Sha1',
'\n ' + ' '.join([checksums['sha1'], debsize, deb_basename])),
MakeDebianControlField(
'Checksums-Sha256',
'\n ' + ' '.join([checksums['sha256'], debsize, deb_basename]))

But MakeDebianControlField() promptly strips it away

value = value.rstrip()
if not is_multiline:
value = value.strip()
if '\n' in value:
raise ValueError(

A trivial fix could be to write out Files:\n " + " ".join([...]) and skip calling MakeDebianControlField()?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2An issue that should be worked on when time is availablebug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions