Packages

Packages are represented by the metadata read from Debian RFC822 paragraphs in a repository’s distribution’s component’s architecture’s Packages file. The Package class avoids loading the actual package archives from the filesystem until absolutely necessary (i.e., reading the change log).

exception debrepo.packages.InvalidPackage[source]
class debrepo.packages.Package(deb822data, repo=None, filters=[])[source]

A single Debian package described by a repository’s Packages file

Given a Debian RFC822 paragraph parsed into a dictionary, and an optional set of filters, create a representation of a Debian package archive suitable for inspecting repository contents.

Filters of type TransformFilter with what set to Package are processed after the dictionary is interpreted. The transform() method is given the instance of Package as its only argument.

Filters of type TransformFilter with what set to debian.changelog.ChangeBlock are processed after each changelog block is loaded. The transform() method is given the instance of debian.changelog.ChangeBlock as its only argument.

Filters of type ExcludeFilter with what set to debian.changelog.ChangeBlock are processed while the changelog is loaded. If a ChangeBlock matches the exclusion, it is not included in the changelog.

If repo is a path to a repository root, the package changelog will be loadable when changelog() is invoked. See: changelog().

changelog()[source]

Returns the package’s changelog

If the packagea archive has not yet been loaded and repo is defined (see: Package), this method will load it and store it in the _changelog attribute. To force a changelog reload from the package archive, set _changelog to None.