Skip to content

Parsing debian package index fails if "Package" key is not on first line. #181

@duncan485

Description

@duncan485

Although the debian repository format describes that a stanza should begin with 'Package' it also states that clients may accept other formats.

Each stanza shall begin with a "Package" field. Clients may also accept files where this is not the case. (see https://wiki.debian.org/DebianRepository/Format)

However, the _parse_repository fails if the first line is not Package.

if not last_key and len(pkg) == 0 and key != "Package":

In my opinion, the parses should only fail when there no "Package" key in the block of lines. Although unconventional, below should be parsed correctly.

Architecture: amd64
Description: HelloWorld
Maintainer: HelloWorld
Package: helloworld
Priority: optional
Section: devel
Version: 0.0.1
...etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions