Repositories

Debian repositories contain a nested hierarchy. Repositories have distributions, which have components, which have architectures, which have packages. The classes below represent this hierarchy. In general, creating an instance at one level of the hierarchy automatically causes instances to be created for all the lower levels by reading from the filesystem.

exception debrepo.repos.InvalidRepo[source]
exception debrepo.repos.InvalidDist[source]
exception debrepo.repos.InvalidComponent[source]
exception debrepo.repos.InvalidArch[source]
class debrepo.repos.Repo(path, strict=False, filters=[])[source]

A subdivision of a compose containing distributions

Given a path to a repository directory, and an optional set of filters, load a repository and all its subcomponents from the filesystem. If strict is True, any unexpected content will cause the loading of the hierarchy to halt and fail with an exception.

Filters of type TransformFilter with what set to Repo are processed after the entire hierarchy, from the repository down, is loaded (so, after all other filters have been processed). The transform() method is given the instance of Repo as its only argument.

Filters of type ExcludeFilter with what set to Dist are applied while scanning distribution directories. If a directory matches the exclusion, it is not scanned, and a Dist object for the directory is not created. The omission of the distribution does not cause a failure in strict mode.

get_dist(dist_name)[source]

Select dist object by name

class debrepo.repos.Dist(path, strict=False, filters=[])[source]

A subdivision of a repository containing components

Given a path to a distribution directory, and an optional set of filters, load a distribution and all its subcomponents from the filesystem. If strict is True, any unexpected content will cause the loading of the hierarchy to halt and fail with an exception.

Filters of type TransformFilter with what set to Dist are processed after the entire hierarchy, from the distribution down, is loaded (so, after all other filters have been processed). The transform() method is given the instance of Dist as its only argument.

Filters of type ExcludeFilter with what set to Component are applied while scanning component directories. If a directory matches the exclusion, it is not scanned, and a Component object for the directory is not created. The omission of the component does not cause a failure in strict mode.

get_component(component_name)[source]

Select component object by name

class debrepo.repos.Component(path, arches, strict=False, filters=[])[source]

A subdivision of a distribution containing architectures

Given a path to a component directory, a list of valid arches, and an optional set of filters, load a component and all its subcomponents from the filesystem. If strict is True, any unexpected content will cause the loading of the hierarchy to halt and fail with an exception.

Filters of type TransformFilter with what set to Component are processed after the entire hierarchy, from the component down, is loaded (so, after all other filters have been processed). The debrepo.filters.TransformFilter.transform() method is given the instance of Component as its only argument.

Filters of type ExcludeFilter with what set to Arch are applied while scanning architecture directories. If a directory matches the exclusion, it is not scanned, and an Arch object for the directory is not created. The omission of the architecture does not cause a failure in strict mode.

get_arch(arch_name)[source]

Select arch object by name

class debrepo.repos.Arch(path, strict=False, filters=[])[source]

A subdivision of component containing packages.

Given a path to an architecture directory, and an optional set of filters, load an architecture and all its subcomponents from the filesystem. If strict is True, any unexpected content will cause the loading of the hierarchy to halt and fail with an exception.

Filters of type TransformFilter with what set to Arch are processed after the entire hierarchy, from the architecture down, is loaded (so, after all other filters have been processed). The transform() method is given the instance of Arch as its only argument.

Filters of type ExcludeFilter with what set to Package are applied while reading the Packages file. If an entry matches the exclusion, it is not scanned, and a Package instance for the entry is not created.

get_package(package_name)[source]

Select package object by name