Skip to content

Latest commit

 

History

History
129 lines (73 loc) · 4.54 KB

api_repos.rst

File metadata and controls

129 lines (73 loc) · 4.54 KB

Repository Configuration

Dictionary mapping repository IDs to the respective dnf.repo.Repo objects. Derived from the standard dict.

add(repo)

Add a .Repo to the repodict.

all()

Return a list of all contained repositories.

See the note at get_matching for special semantics of the returned object.

get_matching(key)

Return a list of repositories which ID matches (possibly globbed) key or an empty list if no matching repository is found.

The returned list acts as a composite, transparently forwarding all method calls on itself to the contained repositories. The following thus disables all matching repos:

repos = base.repos.get_matching('*-debuginfo')
repos.disable()

iter_enabled()

Return an iterator over all enabled repos from the dict.

dnf.repo

repo_id_invalid(repo_id)

Return index of the first invalid character in the repo_id or None if all characters are valid. This function is used to validate the section names in .repo files.

Represents the metadata files.

fresh

Boolean. True if the metadata was loaded from the origin, False if it was loaded from the cache.

Repository object used for metadata download. To configure it properly one has to give it either metalink, mirrorlist or baseurl parameter.

baseurl

List of URLs for this repository. Defaults to [].

id

ID of this repo.

metadata

If ~load has been called and succeeded, this contains the relevant Metadata instance.

metalink

URL of a metalink for this repository. Defaults to None

mirrorlist

URL of a mirrorlist for this repository. Defaults to None

name

A string with the repo's name.

pkgdir

Directory where packages of a remote repo will be downloaded to. By default it is derived from cachedir in .__init__ but can be overriden by assigning to this attribute.

proxy

URL of of a proxy server to use when connecting to this repo. Defaults to None, i.e. no proxy used. Also see .Conf.proxy.

proxy_username

The username to use for connecting to the proxy server. Defaults to None.

proxy_password

The password to use for connecting to the proxy server. Defaults to None.

sslverify

Whether SSL certificate checking should be performed at all. Defaults to True.

__init__(id, cachedir)

Init repository with ID id_ and using the cachedir path for storing downloaded and temporary files.

disable()

Disable the repository. Repositories are enabled by default.

enable()

Enable the repository (the default).

load()

Load the metadata of this repository. Will try to use local cache if possible and initiate and finish download if not. Returns True if fresh metadata has been downloaded and False if cache was used. Raises dnf.exceptions.RepoError if the repo metadata could not be obtained.

set_progress_bar(progress)

Set the download progress reporting object for this repo during load. progress must be an instance of dnf.callback.DownloadProgress.