Librepo library
1.7.13
C library for downloading linux repository metadata and packages
|
Macros | |
#define | LRO_FASTESTMIRRORMAXAGE_DEFAULT 2592000 |
#define | LRO_FASTESTMIRRORMAXAGE_MIN 0 |
#define | LRO_PROXYPORT_DEFAULT 1080 |
#define | LRO_PROXYTYPE_DEFAULT LR_PROXY_HTTP |
#define | LRO_MAXSPEED_DEFAULT G_GINT64_CONSTANT(0) |
#define | LRO_CONNECTTIMEOUT_DEFAULT 120 |
#define | LRO_MAXMIRRORTRIES_DEFAULT 0 |
#define | LRO_MAXMIRRORTRIES_MIN 0 |
#define | LRO_MAXPARALLELDOWNLOADS_DEFAULT 3 |
#define | LRO_MAXPARALLELDOWNLOADS_MIN 1 |
#define | LRO_MAXPARALLELDOWNLOADS_MAX 20 |
#define | LRO_MAXDOWNLOADSPERMIRROR_DEFAULT 3 |
#define | LRO_MAXDOWNLOADSPERMIRROR_MIN 1 |
#define | LRO_LOWSPEEDTIME_MIN 0 |
#define | LRO_LOWSPEEDTIME_DEFAULT 120 |
#define | LRO_LOWSPEEDLIMIT_MIN 0 |
#define | LRO_LOWSPEEDLIMIT_DEFAULT 1000 |
#define | LRO_IPRESOLVE_DEFAULT LR_IPRESOLVE_WHATEVER |
#define | LRO_ALLOWEDMIRRORFAILURES_DEFAULT 4 |
#define | LRO_ADAPTIVEMIRRORSORTING_DEFAULT 1 |
#define | LRO_GNUPGHOMEDIR_DEFAULT NULL |
#define | LRO_FASTESTMIRRORTIMEOUT_DEFAULT 2.0 |
Typedefs | |
typedef struct _LrHandle | LrHandle |
Functions | |
LrHandle * | lr_handle_init () |
void | lr_handle_free (LrHandle *handle) |
gboolean | lr_handle_setopt (LrHandle *handle, GError **err, LrHandleOption option,...) |
gboolean | lr_handle_getinfo (LrHandle *handle, GError **err, LrHandleInfoOption option,...) |
gboolean | lr_handle_perform (LrHandle *handle, LrResult *result, GError **err) |
#define LRO_ADAPTIVEMIRRORSORTING_DEFAULT 1 |
#define LRO_ALLOWEDMIRRORFAILURES_DEFAULT 4 |
#define LRO_CONNECTTIMEOUT_DEFAULT 120 |
#define LRO_FASTESTMIRRORMAXAGE_DEFAULT 2592000 |
#define LRO_FASTESTMIRRORMAXAGE_MIN 0 |
#define LRO_FASTESTMIRRORTIMEOUT_DEFAULT 2.0 |
#define LRO_IPRESOLVE_DEFAULT LR_IPRESOLVE_WHATEVER |
#define LRO_LOWSPEEDLIMIT_DEFAULT 1000 |
#define LRO_LOWSPEEDLIMIT_MIN 0 |
#define LRO_LOWSPEEDTIME_DEFAULT 120 |
#define LRO_LOWSPEEDTIME_MIN 0 |
#define LRO_MAXDOWNLOADSPERMIRROR_DEFAULT 3 |
#define LRO_MAXDOWNLOADSPERMIRROR_MIN 1 |
#define LRO_MAXMIRRORTRIES_DEFAULT 0 |
#define LRO_MAXMIRRORTRIES_MIN 0 |
#define LRO_MAXPARALLELDOWNLOADS_DEFAULT 3 |
#define LRO_MAXPARALLELDOWNLOADS_MAX 20 |
#define LRO_MAXPARALLELDOWNLOADS_MIN 1 |
#define LRO_MAXSPEED_DEFAULT G_GINT64_CONSTANT(0) |
#define LRO_PROXYPORT_DEFAULT 1080 |
#define LRO_PROXYTYPE_DEFAULT LR_PROXY_HTTP |
typedef struct _LrHandle LrHandle |
enum LrHandleInfoOption |
Handle options for the lr_handle_getinfo function.
Enumerator | |
---|---|
LRI_UPDATE |
(long *) |
LRI_URLS |
(char ***) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function. |
LRI_MIRRORLIST |
(char **) |
LRI_MIRRORLISTURL |
(char **) |
LRI_METALINKURL |
(char **) |
LRI_LOCAL |
(long *) |
LRI_PROGRESSCB |
(void *) |
LRI_PROGRESSDATA |
(LrProgressCb) |
LRI_DESTDIR |
(char **) |
LRI_REPOTYPE |
(long *) |
LRI_USERAGENT |
(char **) |
LRI_YUMDLIST |
(char ***) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function. |
LRI_YUMBLIST |
(char ***) NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function. |
LRI_FETCHMIRRORS |
(long *) |
LRI_MAXMIRRORTRIES |
(long *) |
LRI_VARSUB |
(LrUrlVars **) |
LRI_MIRRORS |
(char ***) Mirrorlist associated with the repository. If LRO_MIRRORLIST was specified, then content of this list is created from the specified mirrorlist. If no LRO_MIRRORLIST was specified and repository is on a local filesystem and contains a mirrorlist then the mirrorlist is automatically loaded. Mirrors from this list are used for downloading only if the mirrorlist was specified by LRO_MIRRORLIST option! Automatically loaded mirrorlist from a local repository is not implicitly used for downloading! NOTE: Returned list must be freed as well as all its items! You could use g_strfreev() function. |
LRI_METALINK |
(LrMetalink *) |
LRI_FASTESTMIRROR |
(long *) |
LRI_FASTESTMIRRORCACHE |
(char **) |
LRI_FASTESTMIRRORMAXAGE |
(long *) |
LRI_HMFCB |
(LrHandleMirrorFailureCb) |
LRI_SSLVERIFYPEER |
(long *) |
LRI_SSLVERIFYHOST |
(long *) |
LRI_IPRESOLVE |
(LrIpResolveType *) |
LRI_ALLOWEDMIRRORFAILURES |
(long *) |
LRI_ADAPTIVEMIRRORSORTING |
(long *) |
LRI_GNUPGHOMEDIR |
(char **) |
LRI_FASTESTMIRRORTIMEOUT |
(double *) |
enum LrHandleOption |
Handle options for the lr_handle_setopt function.
Enumerator | |
---|---|
LRO_UPDATE |
(long 1 or 0) Update existing repo in LrResult. Update means download missing (previously omitted) metadata file(s). |
LRO_URLS |
(char ** NULL-terminated) List of base repo URLs |
LRO_MIRRORLIST |
(char *) Mirrorlist or metalink url. This option is DEPRECATED |
LRO_MIRRORLISTURL |
(char *) Mirrorlist url |
LRO_METALINKURL |
(char *) Metalink url |
LRO_LOCAL |
(long 1 or 0) Do not duplicate local metadata, just locate the old one |
LRO_HTTPAUTH |
(long 1 or 0) Enable all supported method of HTTP authentification. |
LRO_USERPWD |
(char *) User and password for http authetification in format user:password |
LRO_PROXY |
(char *) Address of proxy server eg. "proxy-host.com:8080" |
LRO_PROXYPORT |
(long) Set port number for proxy separately. Default port is 1080. |
LRO_PROXYTYPE |
(LrProxyType) Type of the proxy used. |
LRO_PROXYAUTH |
(long 1 or 0) Enable all supported method for proxy authentification |
LRO_PROXYUSERPWD |
(char *) User and password for proxy in format user:password |
LRO_PROGRESSCB |
(LrProgressCb) Progress callback |
LRO_PROGRESSDATA |
(void *) Progress callback user data |
LRO_MAXSPEED |
(gint64) Maximum download speed in bytes per second. Default is 0 = unlimited download speed. |
LRO_DESTDIR |
(char *) Where to save downloaded files |
LRO_REPOTYPE |
(LrRepotype) Type of downloaded repo, currently only supported is LR_YUMREPO. |
LRO_CONNECTTIMEOUT |
(long) Max time in sec for connection phase. default timeout is 300 seconds. |
LRO_IGNOREMISSING |
(long 1 or 0) If you want to localise (LRO_LOCAL is enabled) a incomplete local repository (eg. only primary and filelists are present) you could use LRO_YUMDLIST and specify only file that are present, or use this option. |
LRO_INTERRUPTIBLE |
(long 1 or 0) If true, Librepo setups its own signal handler for SIGTERM and stops downloading if SIGTERM is catched. In this case current operation could return any kind of error code. Handle which operation was interrupted shoud never be used again! |
LRO_USERAGENT |
(char *) String for User-Agent: header in the http request sent to the remote server |
LRO_FETCHMIRRORS |
(long 1 or 0) If true - do not download anything, except mirrorlist or metalink (during lr_handle_perform()). |
LRO_MAXMIRRORTRIES |
(long) If download fails try at most the specified number of mirrors. 0 means try all available mirrors. |
LRO_MAXPARALLELDOWNLOADS |
(long) Maximum number of parallel downloads. |
LRO_MAXDOWNLOADSPERMIRROR |
(long) Maximum number of parallel downloads per mirror. |
LRO_VARSUB |
(LrUrlVars *) Variables and its substitutions for repo URL. [{"releasever", "f18"}], ...; (e.g.: http://foo/$releasever => http://foo/f18) LrUrlVars has to be constructed by the lr_urlvars_set() function. After set the list to the handle, it has not to be freed! Handle itself takes care about freeing the list. |
LRO_FASTESTMIRROR |
(long 1 or 0) Sort the internal mirrorlist, after it is constructed, by the determined connection speed. Disabled by default. |
LRO_FASTESTMIRRORCACHE |
(char *) Path to the fastestmirror's cache file. Used when LRO_FASTESTMIRROR is enabled. If it doesn't exists, it will be created. |
LRO_GPGCHECK |
(long 1 or 0) Check GPG signature if available |
LRO_CHECKSUM |
(long 1 or 0) Check files checksum if available |
LRO_YUMDLIST |
(char ** NULL-terminated) Download only specified records from repomd (e.g. ["primary", "filelists", NULL]). Note: Last element of the list must be NULL! |
LRO_YUMBLIST |
(char ** NULL-terminated) Do not download this specified records from repomd (blacklist). Note: Last element of the list must be NULL! |
LRO_HMFCB |
(LrHandleMirrorFailureCb) Handle specific mirror failure callaback. Callback called when a repodata download from a mirror fails. This callback gets the user data setted by LRO_PROGRESSDATA |
LRO_SSLVERIFYPEER |
(long 1 or 0) This option determines whether librepo verifies the authenticity of the peer's certificate. This trust is based on a chain of digital signatures, rooted in certification authority (CA) certificates. |
LRO_SSLVERIFYHOST |
(long 1 or 0) This option determines whether librepo verifies that the server cert is for the server it is known as. |
LRO_IPRESOLVE |
(LrIpResolveType) Sets what kind of IP addresses to use when resolving host names. |
LRO_ALLOWEDMIRRORFAILURES |
(long) If all transfers from a mirror failed (no successful transfer from the mirror exists) and the number of failed downloads is higher or equal to this value the mirror will be skipped (ignored) for all next downloads. Note: Number of failed transfers for a single mirror can outreach this number! For example, if you set this value to 1 but you allow 3 parallel downloads it is possible that all three downloads start from the mirror, before any of them can fail. Then, if all three transfers fail, the number of failures for the mirror will be 3, even if this option was set to 1. Set -1 or 0 to disable this option |
LRO_ADAPTIVEMIRRORSORTING |
(long 1 or 0) If enabled, internal list of mirrors for each handle is re-sorted after each finished transfer. The the sorting is based on mirror error rate etc. |
LRO_GNUPGHOMEDIR |
(char *) Configuration directory for GNUPG (a directory with keyring) |
LRO_FASTESTMIRRORTIMEOUT |
(double) Max length of fastest mirror measurement in seconds. Default value is 2sec |
LRO_SENTINEL |
Sentinel |
void lr_handle_free | ( | LrHandle * | handle | ) |
Frees handle and its content.
handle | Handle. |
gboolean lr_handle_getinfo | ( | LrHandle * | handle, |
GError ** | err, | ||
LrHandleInfoOption | option, | ||
... | |||
) |
Get information from handle. Most of returned pointers point directly to the handle internal values and therefore you should assume that they are only valid until any manipulation (lr_handle_setopt, lr_handle_perform, ...) with handle occurs. NOTE: You should not free or modify the memory returned by this function unless it is explicitly mentioned!
handle | Librepo handle. |
err | GError ** |
option | Option from LrHandleInfoOption enum. |
... | Apropriate variable fro the selected option. |
LrHandle* lr_handle_init | ( | ) |
Return new handle.
Perform repodata download or location.
handle | Librepo handle. |
result | Librepo result. |
err | GError ** |
gboolean lr_handle_setopt | ( | LrHandle * | handle, |
GError ** | err, | ||
LrHandleOption | option, | ||
... | |||
) |
Set option (LrHandleOption) of the handle.
handle | Handle. |
err | GError ** |
option | Option from LrHandleOption enum. |
... | Value for the option. |