XBPS Library API 20240111
The X Binary Package System
|
Functions | |
bool | xbps_repo_store (struct xbps_handle *xhp, const char *url) |
bool | xbps_repo_remove (struct xbps_handle *xhp, const char *url) |
bool | xbps_repo_lock (struct xbps_handle *xhp, const char *uri, int *lockfd, char **lockfname) |
void | xbps_repo_unlock (int lockfd, char *lockfname) |
struct xbps_repo * | xbps_repo_open (struct xbps_handle *xhp, const char *uri) |
struct xbps_repo * | xbps_repo_stage_open (struct xbps_handle *xhp, const char *uri) |
struct xbps_repo * | xbps_repo_public_open (struct xbps_handle *xhp, const char *uri) |
void | xbps_repo_close (struct xbps_repo *repo) |
void | xbps_repo_release (struct xbps_repo *repo) |
char * | xbps_repo_path (struct xbps_handle *xhp, const char *url) |
char * | xbps_repo_path_with_name (struct xbps_handle *xhp, const char *url, const char *name) |
bool | xbps_repo_fetch_remote (struct xbps_repo *repo, const char *url) |
xbps_dictionary_t | xbps_repo_get_pkg (struct xbps_repo *repo, const char *pkg) |
xbps_dictionary_t | xbps_repo_get_virtualpkg (struct xbps_repo *repo, const char *pkg) |
xbps_array_t | xbps_repo_get_pkg_revdeps (struct xbps_repo *repo, const char *pkg) |
int | xbps_repo_key_import (struct xbps_repo *repo) |
bool xbps_repo_store | ( | struct xbps_handle * | xhp, |
const char * | url | ||
) |
Stores repository url into the repository pool.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | url | Repository URI to store. |
Definition at line 267 of file repo.c.
References xbps_handle::repositories, xbps_match_string_in_array(), xbps_repository_is_remote(), and xbps_repo::xhp.
bool xbps_repo_remove | ( | struct xbps_handle * | xhp, |
const char * | url | ||
) |
Removes repository url from the repository pool.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | url | Repository URI to remove. |
Definition at line 306 of file repo.c.
References xbps_handle::repositories, xbps_remove_string_from_array(), and xbps_repo::xhp.
Referenced by xbps_rpool_foreach().
bool xbps_repo_lock | ( | struct xbps_handle * | xhp, |
const char * | uri, | ||
int * | lockfd, | ||
char ** | lockfname | ||
) |
Creates a lock for a local repository to obtain exclusive access (write).
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | uri | Repository URI to match. |
[out] | lockfd | Lock file descriptor assigned. |
[out] | lockfname | Lock filename assigned. |
Definition at line 86 of file repo.c.
References xbps_repo_path(), and xbps_xasprintf().
void xbps_repo_unlock | ( | int | lockfd, |
char * | lockfname | ||
) |
struct xbps_repo * xbps_repo_open | ( | struct xbps_handle * | xhp, |
const char * | uri | ||
) |
Opens a repository and returns a xbps_repo object.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | uri | Repository URI to match. |
Definition at line 340 of file repo.c.
References xbps_repo::idx, xbps_repo::is_remote, xbps_repo_public_open(), xbps_repo_release(), xbps_repo_stage_open(), and xbps_repo::xhp.
Referenced by xbps_rpool_foreach().
struct xbps_repo * xbps_repo_stage_open | ( | struct xbps_handle * | xhp, |
const char * | uri | ||
) |
Opens a staging repository and returns a xbps_repo object.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | uri | Repository URI to match. |
Definition at line 329 of file repo.c.
References xbps_repo::xhp.
Referenced by xbps_repo_open().
struct xbps_repo * xbps_repo_public_open | ( | struct xbps_handle * | xhp, |
const char * | uri | ||
) |
Opens a repository and returns a xbps_repo object.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | uri | Repository URI to match. |
Definition at line 335 of file repo.c.
References xbps_repo::xhp.
Referenced by xbps_repo_open().
void xbps_repo_close | ( | struct xbps_repo * | repo | ) |
Closes a repository object, its archive associated is closed and those resources released.
[in] | repo | The repository object to close. |
Definition at line 372 of file repo.c.
Referenced by xbps_repo_release().
void xbps_repo_release | ( | struct xbps_repo * | repo | ) |
This calls xbps_repo_close() and releases all resources associated with this repository object.
[in] | repo | The repository object to release. |
Definition at line 388 of file repo.c.
References xbps_repo::idx, xbps_repo::idxmeta, and xbps_repo_close().
Referenced by xbps_repo_open().
char * xbps_repo_path | ( | struct xbps_handle * | xhp, |
const char * | url | ||
) |
Returns a heap-allocated string with the repository local path.
[in] | xhp | The xbps_handle object. |
[in] | url | The repository URL to match. |
Definition at line 51 of file repo.c.
References xbps_repo_path_with_name().
Referenced by xbps_repo_lock().
char * xbps_repo_path_with_name | ( | struct xbps_handle * | xhp, |
const char * | url, | ||
const char * | name | ||
) |
Returns a heap-allocated string with the repository local path.
[in] | xhp | The xbps_handle object. |
[in] | url | The repository URL to match. |
[in] | name | The repository name (stage or repodata) |
Definition at line 57 of file repo.c.
References xbps_handle::native_arch, xbps_handle::target_arch, and xbps_xasprintf().
Referenced by xbps_repo_path().
bool xbps_repo_fetch_remote | ( | struct xbps_repo * | repo, |
const char * | url | ||
) |
Remotely fetch repository data and keep it in memory.
[in] | repo | A struct xbps_repo pointer to be filled in. |
[in] | url | Full url to the target remote repository data archive. |
Definition at line 184 of file plist_fetch.c.
References xbps_repo::idx, xbps_repo::idxmeta, and xbps_repo::is_signed.
xbps_dictionary_t xbps_repo_get_pkg | ( | struct xbps_repo * | repo, |
const char * | pkg | ||
) |
Returns a pkg dictionary from a repository repo matching the expression pkg.
[in] | repo | Pointer to an xbps_repo structure. |
[in] | pkg | Package expression to match in this repository index. |
Definition at line 441 of file repo.c.
References xbps_repo::idx, xbps_repo::uri, xbps_pkg_name(), and xbps_repo::xhp.
Referenced by xbps_repo_get_pkg_revdeps().
xbps_dictionary_t xbps_repo_get_virtualpkg | ( | struct xbps_repo * | repo, |
const char * | pkg | ||
) |
Returns a pkg dictionary from a repository repo matching the expression pkg. On match the first package matching the virtual package expression will be returned.
[in] | repo | Pointer to an xbps_repo structure. |
[in] | pkg | Package expression to match in this repository index. |
Definition at line 407 of file repo.c.
References xbps_repo::idx, xbps_repo::uri, xbps_pkg_name(), and xbps_repo::xhp.
Referenced by xbps_repo_get_pkg_revdeps().
xbps_array_t xbps_repo_get_pkg_revdeps | ( | struct xbps_repo * | repo, |
const char * | pkg | ||
) |
Returns a proplib array of strings with reverse dependencies from repository repo matching the expression pkg.
[in] | repo | Pointer to an xbps_repo structure. |
[in] | pkg | Package expression to match in this repository index. |
Definition at line 569 of file repo.c.
References xbps_repo::idx, xbps_pkg_name(), xbps_repo_get_pkg(), and xbps_repo_get_virtualpkg().
int xbps_repo_key_import | ( | struct xbps_repo * | repo | ) |
Imports the RSA public key of target repository. The repository must be signed properly for this to work.
[in] | repo | Pointer to the target xbps_repo structure. |
Definition at line 611 of file repo.c.
References xbps_repo::idxmeta, xbps_handle::metadir, xbps_repo::uri, xbps_mkpath(), xbps_plist_dictionary_from_file(), xbps_pubkey2fp(), xbps_xasprintf(), and xbps_repo::xhp.