![]() |
XBPS Library API
0.19
The X Binary Package System
|
Functions | |
int | xbps_pkg_exec_buffer (struct xbps_handle *xhp, const void *blob, const size_t blobsiz, const char *pkgname, const char *version, const char *action, bool update) |
int | xbps_pkg_exec_script (struct xbps_handle *xhp, prop_dictionary_t d, const char *script, const char *action, bool update) |
int | xbps_pkgdb_foreach_cb (struct xbps_handle *xhp, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
int | xbps_pkgdb_foreach_reverse_cb (struct xbps_handle *xhp, int(*fn)(struct xbps_handle *, prop_object_t, void *, bool *), void *arg) |
prop_dictionary_t | xbps_pkgdb_get_pkg (struct xbps_handle *xhp, const char *pkg) |
prop_dictionary_t | xbps_pkgdb_get_pkg_metadata (struct xbps_handle *xhp, const char *pkg) |
prop_array_t | xbps_pkgdb_get_pkg_revdeps (struct xbps_handle *xhp, const char *pkg) |
prop_dictionary_t | xbps_pkgdb_get_virtualpkg (struct xbps_handle *xhp, const char *pkg) |
bool | xbps_pkgdb_remove_pkg (struct xbps_handle *xhp, const char *pkg, bool flush) |
bool | xbps_pkgdb_replace_pkg (struct xbps_handle *xhp, prop_dictionary_t pkgd, const char *pkg, bool flush) |
int | xbps_pkgdb_update (struct xbps_handle *xhp, bool flush) |
Functions to manipulate the main package database plist file (pkgdb).
The following image shown below shows the proplib structure used by the main package database plist:
Legend:
Text inside of white boxes are the key associated with the object, its data type is specified on its edge, i.e array, bool, integer, string, dictionary.
int xbps_pkg_exec_buffer | ( | struct xbps_handle * | xhp, |
const void * | blob, | ||
const size_t | blobsiz, | ||
const char * | pkgname, | ||
const char * | version, | ||
const char * | action, | ||
bool | update | ||
) |
Creates a temporary file and executes it in rootdir.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | blob | The buffer pointer where the data is stored. |
[in] | blobsiz | The size of the buffer data. |
[in] | pkgname | The package name associated. |
[in] | version | The package version associated. |
[in] | action | The action to execute on the temporary file. |
[in] | update | Set to true if package is being updated. |
Definition at line 35 of file package_script.c.
References xbps_handle::conffile, xbps_handle::rootdir, and xbps_xasprintf().
Referenced by xbps_pkg_exec_script().
int xbps_pkg_exec_script | ( | struct xbps_handle * | xhp, |
prop_dictionary_t | d, | ||
const char * | script, | ||
const char * | action, | ||
bool | update | ||
) |
Creates a temporary file and executes it in rootdir.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | d | Package dictionary where the script data is stored. |
[in] | script | Key associated with the script in dictionary. |
[in] | action | The action to execute on the temporary file. |
[in] | update | Set to true if package is being updated. |
Definition at line 101 of file package_script.c.
References xbps_pkg_exec_buffer().
Referenced by xbps_configure_pkg(), and xbps_remove_pkg().
int xbps_pkgdb_foreach_cb | ( | struct xbps_handle * | xhp, |
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback per a package dictionary registered in master package database (pkgdb) plist (downwards).
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | fn | Function callback to run for any pkg dictionary. |
[in] | arg | Argument to be passed to the function callback. |
int xbps_pkgdb_foreach_reverse_cb | ( | struct xbps_handle * | xhp, |
int(*)(struct xbps_handle *, prop_object_t, void *, bool *) | fn, | ||
void * | arg | ||
) |
Executes a function callback per a package dictionary registered in master package database (pkgdb) plist, in reverse order (upwards).
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | fn | Function callback to run for any pkg dictionary. |
[in] | arg | Argument to be passed to the function callback. |
Definition at line 156 of file pkgdb.c.
Referenced by xbps_find_pkg_orphans().
prop_dictionary_t xbps_pkgdb_get_pkg | ( | struct xbps_handle * | xhp, |
const char * | pkg | ||
) |
Returns a package dictionary from master package database (pkgdb) plist, matching pkgname or pkgver object in pkg.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkg | Package name or name-version to match. |
Definition at line 172 of file pkgdb.c.
Referenced by xbps_configure_pkg(), xbps_pkg_is_installed(), xbps_pkg_state_installed(), xbps_pkgdb_get_pkg_metadata(), xbps_pkgdb_get_pkg_revdeps(), xbps_register_pkg(), xbps_set_pkg_state_installed(), xbps_transaction_install_pkg(), and xbps_transaction_remove_pkg().
prop_dictionary_t xbps_pkgdb_get_pkg_metadata | ( | struct xbps_handle * | xhp, |
const char * | pkg | ||
) |
Returns the package dictionary with all metadata info for pkg.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkg | Package expression to match. |
Definition at line 297 of file pkgdb.c.
References xbps_pkgdb_get_pkg().
prop_array_t xbps_pkgdb_get_pkg_revdeps | ( | struct xbps_handle * | xhp, |
const char * | pkg | ||
) |
Returns a proplib array of strings with reverse dependencies for pkg. The array is generated dynamically based on the list of packages currently installed.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkg | Package expression to match. |
Definition at line 282 of file pkgdb.c.
References xbps_pkgdb_get_pkg().
Referenced by xbps_transaction_remove_pkg().
prop_dictionary_t xbps_pkgdb_get_virtualpkg | ( | struct xbps_handle * | xhp, |
const char * | pkg | ||
) |
Returns a package dictionary from master package database (pkgdb) plist, matching virtual pkgname or pkgver object in pkg.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkg | Package name or name-version to match. |
Definition at line 181 of file pkgdb.c.
Referenced by xbps_pkg_is_installed(), and xbps_transaction_install_pkg().
bool xbps_pkgdb_remove_pkg | ( | struct xbps_handle * | xhp, |
const char * | pkg, | ||
bool | flush | ||
) |
Removes a package dictionary from master package database (pkgdb) plist, matching pkgname or pkgver object in pkg.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkg | Package name or pattern to match in a package dictionary. |
[in] | flush | If true, after successful replace the pkgdb contents in memory will be flushed atomically to storage. |
Definition at line 309 of file pkgdb.c.
References xbps_pkg_version(), xbps_pkgdb_update(), and xbps_pkgpattern_version().
Referenced by xbps_unregister_pkg().
bool xbps_pkgdb_replace_pkg | ( | struct xbps_handle * | xhp, |
prop_dictionary_t | pkgd, | ||
const char * | pkg, | ||
bool | flush | ||
) |
Replaces a package dictionary with dict in the master package database (pkgdb) plist, matching pkgname or pkgver object.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | pkgd | Proplib dictionary to be added into pkgdb. |
[in] | pkg | Package name or pattern to match in a package dictionary. |
[in] | flush | If true, after successful replace the pkgdb contents in memory will be flushed atomically to storage. |
Definition at line 333 of file pkgdb.c.
References xbps_pkgdb_update(), and xbps_pkgpattern_version().
Referenced by xbps_register_pkg().
int xbps_pkgdb_update | ( | struct xbps_handle * | xhp, |
bool | flush | ||
) |
Updates the master package database (pkgdb) plist with new contents from disk to the cached copy in memory.
[in] | xhp | The pointer to the xbps_handle struct. |
[in] | flush | If true the pkgdb plist contents in memory will be flushed atomically to storage. |
Definition at line 80 of file pkgdb.c.
References xbps_handle::metadir, and xbps_xasprintf().
Referenced by xbps_configure_packages(), xbps_configure_pkg(), xbps_pkgdb_remove_pkg(), and xbps_pkgdb_replace_pkg().