XBPS Library API 20240111
The X Binary Package System
Data Structures | Functions
Repository pool functions

Data Structures

struct  xbps_repo
 Repository structure. More...
 

Functions

int xbps_rpool_sync (struct xbps_handle *xhp, const char *uri)
 
int xbps_rpool_foreach (struct xbps_handle *xhp, int(*fn)(struct xbps_repo *, void *, bool *), void *arg)
 
struct xbps_repoxbps_rpool_get_repo (const char *url)
 
xbps_dictionary_t xbps_rpool_get_pkg (struct xbps_handle *xhp, const char *pkg)
 
xbps_dictionary_t xbps_rpool_get_virtualpkg (struct xbps_handle *xhp, const char *pkg)
 
xbps_array_t xbps_rpool_get_pkg_revdeps (struct xbps_handle *xhp, const char *pkg)
 
xbps_array_t xbps_rpool_get_pkg_fulldeptree (struct xbps_handle *xhp, const char *pkg)
 

Detailed Description


Data Structure Documentation

◆ xbps_repo

struct xbps_repo

Repository object structure registered in a private simple queue. The structure contains repository data: uri and dictionaries associated.

Definition at line 1409 of file xbps.h.

Collaboration diagram for xbps_repo:

Data Fields

struct xbps_handlexhp
 
xbps_dictionary_t idx
 
xbps_dictionary_t idxmeta
 
const charuri
 
bool is_remote
 
bool is_signed
 

Field Documentation

◆ xhp

◆ idx

◆ idxmeta

idxmeta

Proplib dictionary associated with the repository index-meta.

Definition at line 1434 of file xbps.h.

Referenced by xbps_repo_fetch_remote(), xbps_repo_key_import(), xbps_repo_release(), and xbps_verify_signature().

◆ uri

uri

URI string associated with repository.

Definition at line 1440 of file xbps.h.

Referenced by xbps_repo_get_pkg(), xbps_repo_get_virtualpkg(), xbps_repo_key_import(), xbps_rpool_get_repo(), and xbps_verify_signature().

◆ is_remote

bool is_remote

var is_remote

True if repository is remote, false if it's a local repository.

Definition at line 1450 of file xbps.h.

Referenced by xbps_repo_open().

◆ is_signed

bool is_signed

var is_signed

True if this repository has been signed, false otherwise.

Definition at line 1456 of file xbps.h.

Referenced by xbps_repo_fetch_remote().

Function Documentation

◆ xbps_rpool_sync()

int xbps_rpool_sync ( struct xbps_handle xhp,
const char *  uri 
)

Synchronizes repository data for all remote repositories as specified in the configuration file or if uri argument is set, just sync for that repository.

Parameters
[in]xhpPointer to the xbps_handle struct.
[in]uriRepository URI to match for sync (optional).
Returns
0 on success, ENOTSUP if no repositories were found in the configuration file.

◆ xbps_rpool_foreach()

int xbps_rpool_foreach ( struct xbps_handle xhp,
int(*)(struct xbps_repo *, void *, bool *)  fn,
void *  arg 
)

Iterates over the repository pool and executes the fn function callback passing in the void * arg argument to it. The bool pointer argument can be used in the callbacks to stop immediately the loop if set to true, otherwise it will only be stopped if it returns a non-zero value. Removes repos failed to open from pool. This condition causes function to return error, but don't break the loop.

Parameters
[in]xhpPointer to the xbps_handle struct.
[in]fnFunction callback to execute for every repository registered in the pool.
[in]argOpaque data passed in to the fn function callback for client data.
Returns
0 on success, otherwise an errno value.

Definition at line 139 of file rpool.c.

References xbps_handle::repositories, xbps_repo_open(), xbps_repo_remove(), xbps_rpool_get_repo(), and xbps_repo::xhp.

Here is the call graph for this function:

◆ xbps_rpool_get_repo()

struct xbps_repo * xbps_rpool_get_repo ( const char *  url)

Returns a pointer to a struct xbps_repo matching url.

Parameters
[in]urlRepository url to match.
Returns
The matched xbps_repo pointer, NULL otherwise.

Definition at line 112 of file rpool.c.

References xbps_repo::uri.

Referenced by xbps_rpool_foreach().

Here is the caller graph for this function:

◆ xbps_rpool_get_pkg()

xbps_dictionary_t xbps_rpool_get_pkg ( struct xbps_handle xhp,
const char *  pkg 
)

Finds a package dictionary in the repository pool by specifying a package pattern or a package name. This function does not take into account virtual packages, just matches real packages.

Parameters
[in]xhpPointer to the xbps_handle struct.
[in]pkgPackage pattern, exact pkg or pkg name.
Returns
The package dictionary if found, NULL otherwise.
Note
When returned dictionary is no longer needed, you must release it with xbps_object_release(3).

Definition at line 329 of file rpool.c.

References xbps_handle::flags.

◆ xbps_rpool_get_virtualpkg()

xbps_dictionary_t xbps_rpool_get_virtualpkg ( struct xbps_handle xhp,
const char *  pkg 
)

Finds a package dictionary in repository pool by specifying a virtual package pattern or a package name.

Parameters
[in]xhpPointer to the xbps_handle struct.
[in]pkgVirtual package pattern or name to match.
Returns
The package dictionary if found, NULL otherwise.
Note
When returned dictionary is no longer needed, you must release it with xbps_object_release(3).

Definition at line 323 of file rpool.c.

◆ xbps_rpool_get_pkg_revdeps()

xbps_array_t xbps_rpool_get_pkg_revdeps ( struct xbps_handle xhp,
const char *  pkg 
)

Returns a proplib array of strings with reverse dependencies of all registered repositories matching the expression pkg.

Parameters
[in]xhpPointer to the xbps_handle structure.
[in]pkgPackage expression to match in this repository index.
Returns
The array of strings on success, NULL otherwise and errno is set appropiately.

Definition at line 338 of file rpool.c.

◆ xbps_rpool_get_pkg_fulldeptree()

xbps_array_t xbps_rpool_get_pkg_fulldeptree ( struct xbps_handle xhp,
const char *  pkg 
)

Returns a proplib array of strings with a proper sorted list of packages of a full dependency graph for pkg.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkgPackage expression to match.
Returns
A proplib array of strings with the full dependency graph for pkg, NULL otherwise.

Definition at line 344 of file rpool.c.