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

Data Structures

struct  xbps_rindex
 Repository pool index structure. More...
 

Functions

int xbps_rpool_foreach (struct xbps_handle *xhp, int(*fn)(struct xbps_rindex *, void *, bool *), void *arg)
 
prop_dictionary_t xbps_rpool_get_pkg (struct xbps_handle *xhp, const char *pkg)
 
prop_dictionary_t xbps_rpool_get_pkg_plist (struct xbps_handle *xhp, const char *pattern, const char *plistf)
 
prop_dictionary_t xbps_rpool_get_virtualpkg (struct xbps_handle *xhp, const char *pkg)
 
int xbps_rpool_sync (struct xbps_handle *xhp, const char *file, const char *uri)
 

Detailed Description

Function Documentation

int xbps_rpool_foreach ( struct xbps_handle xhp,
int(*)(struct xbps_rindex *, 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.

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 181 of file rpool.c.

References xbps_rindex::repod, xbps_rindex::uri, and xbps_rindex::xhp.

prop_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 prop_object_release(3).

Definition at line 179 of file rpool_get.c.

References xbps_pkg_version(), and xbps_pkgpattern_version().

Referenced by xbps_rpool_get_pkg_plist().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

prop_dictionary_t xbps_rpool_get_pkg_plist ( struct xbps_handle xhp,
const char *  pattern,
const char *  plistf 
)

Iterate over the the repository pool and search for a metadata plist file in a binary package matching `pattern'. If a package is matched the plist file plistf will be internalized into a proplib dictionary.

When pattern is a pkgname, the newest package available in repositories will be used. Otherwise the first repository matching pattern.

Parameters
[in]xhpPointer to the xbps_handle struct.
[in]patternPackage name or package pattern to match, i.e `foo>=1.0'.
[in]plistfPlist file name to match, i.e XBPS_PKGPROPS or XBPS_PKGFILES.
Returns
An internalized proplib dictionary of plistf, otherwise NULL and errno is set appropiately.
Note
if NULL is returned and errno is ENOENT, that means that binary package file has been found but the plist file could not be found.

Definition at line 191 of file rpool_get.c.

References xbps_get_pkg_plist_from_binpkg(), and xbps_rpool_get_pkg().

+ Here is the call graph for this function:

prop_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 prop_object_release(3).

Definition at line 170 of file rpool_get.c.

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

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

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

Definition at line 154 of file rpool.c.

References xbps_fetch_error_string().

+ Here is the call graph for this function: