apt_repo

ReleaseFile

ReleaseFile(self, content)

Class that represents a Release file

Arguments

  • content (str): the content of the Release file

PackagesFile

PackagesFile(self, content)

Class that represents a Packages file

Arguments

  • content (str): the content of the Packages file

packages

Returns all binary packages in this Packages files

BinaryPackage

BinaryPackage(self, content)

Class that represents a binary Debian package

Arguments

  • content (str): the section of the Packages file for this specific package

APTRepository

APTRepository(self, url, dist, components=[])

Class that represents a single APT repository

Arguments

  • url (str): the base URL of the repository
  • dist (str): the target distribution
  • components (list): the target components

Examples

APTRepository('http://archive.ubuntu.com/ubuntu', 'bionic', 'main')
APTRepository('https://pkg.jenkins.io/debian/', 'binary')

all_components

Returns the all components of this repository

packages

Returns all binary packages of this repository

Arguments

  • arch (str): the architecture to return packages for, default: 'amd64'

release_file

Returns the Release file of this repository

from_sources_list_entry

APTRepository.from_sources_list_entry(entry)

Instantiates a new APTRepository object out of a sources.list file entry

Examples

APTRepository.from_sources_list_entry('deb http://archive.ubuntu.com/ubuntu bionic main')

get_binary_packages_by_component

APTRepository.get_binary_packages_by_component(self, component, arch='amd64')

Returns all binary packages of this repository for a given component

Arguments

  • component (str): the component to return packages for
  • arch (str): the architecture to return packages for, default: 'amd64'

get_package

APTRepository.get_package(self, name, version)

Returns a single binary package

Arguments

  • name (str): name of the package
  • version (str): version of the package

get_package_url

APTRepository.get_package_url(self, name, version)

Returns the URL for a single binary package

Arguments

  • name (str): name of the package
  • version (str): version of the package

get_packages_by_name

APTRepository.get_packages_by_name(self, name)

Returns the list of available packages (and it's available versions) for a specific package name

Arguments

  • name (str): name of the package

APTSources

APTSources(self, repositories)

Class that represents a collection of APT repositories

Arguments

  • repositories (list): list of APTRepository objects

packages

Returns all binary packages of all APT repositories

get_package

APTSources.get_package(self, name, version)

Returns a single binary package

Arguments

  • name (str): the name of the package
  • version (str): the version of the package

get_package_url

APTSources.get_package_url(self, name, version)

Returns the URL of a single binary package

Arguments

  • name (str): the name of the package
  • version (str): the version of the package

get_packages_by_name

APTSources.get_packages_by_name(self, name)

Returns the list of available packages (and it's available versions) for a specific package name

Arguments

  • name (str): name of the package