![]() |
XBPS Library API 20250531
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) |
int | xbps_repo_lock (const char *repodir, const char *arch) |
void | xbps_repo_unlock (const char *repodir, const char *arch, int fd) |
struct xbps_repo * | xbps_repo_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) |
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 388 of file repo.c.
References xbps_handle::repositories, xbps_match_string_in_array(), and xbps_repository_is_remote().
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 427 of file repo.c.
References xbps_handle::repositories, and xbps_remove_string_from_array().
Referenced by xbps_rpool_foreach().
int xbps_repo_lock | ( | const char * | repodir, |
const char * | arch | ||
) |
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 49 of file repo.c.
References xbps_repository_is_remote().
void xbps_repo_unlock | ( | const char * | repodir, |
const char * | arch, | ||
int | fd | ||
) |
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 487 of file repo.c.
References xbps_repo::arch, xbps_handle::flags, xbps_repo::idx, xbps_repo::index, xbps_repo::is_remote, xbps_handle::native_arch, xbps_handle::target_arch, xbps_repo::uri, xbps_repo_release(), xbps_repository_is_remote(), and xbps_repo::xhp.
Referenced by xbps_rpool_foreach().
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. |
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. |
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 533 of file repo.c.
References xbps_repo::idx, xbps_repo::idxmeta, and xbps_repo::index.
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. |
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 592 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 558 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 720 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 762 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.