![]() |
XBPS Library API
0.19
The X Binary Package System
|
Functions | |
int | xbps_transaction_autoremove_pkgs (struct xbps_handle *xhp) |
int | xbps_transaction_commit (struct xbps_handle *xhp) |
int | xbps_transaction_install_pkg (struct xbps_handle *xhp, const char *pkg, bool reinstall) |
int | xbps_transaction_prepare (struct xbps_handle *xhp) |
int | xbps_transaction_remove_pkg (struct xbps_handle *xhp, const char *pkgname, bool recursive) |
int | xbps_transaction_update_packages (struct xbps_handle *xhp) |
int | xbps_transaction_update_pkg (struct xbps_handle *xhp, const char *pkgname) |
The following image shows off the full transaction dictionary returned by xbps_transaction_prepare().
Legend:
Text inside of white boxes are the key associated with the object, its data type is specified on its edge, i.e string, array, integer, dictionary.
int xbps_transaction_autoremove_pkgs | ( | struct xbps_handle * | xhp | ) |
Finds all package orphans currently installed and adds them into the transaction dictionary.
[in] | xhp | Pointer to the xbps_handle struct. |
0 | success. |
ENOENT | No package orphans were found. |
ENXIO | |
EINVAL | A problem ocurred in the process. |
Definition at line 320 of file transaction_ops.c.
References xbps_handle::transd, and xbps_find_pkg_orphans().
int xbps_transaction_commit | ( | struct xbps_handle * | xhp | ) |
Commit a transaction. The transaction dictionary in xhp->transd contains all steps to be executed in the transaction, as prepared by xbps_transaction_prepare().
[in] | xhp | Pointer to the xbps_handle struct. |
Definition at line 198 of file transaction_commit.c.
References xbps_handle::transd, xbps_array_iter_from_dict(), xbps_configure_pkg(), xbps_register_pkg(), and xbps_remove_pkg().
int xbps_transaction_install_pkg | ( | struct xbps_handle * | xhp, |
const char * | pkg, | ||
bool | reinstall | ||
) |
Finds a package by name or by pattern and enqueues it into the transaction dictionary for future use. If pkg is a pkgname, the best package version in repository pool will be queued, otherwise the first repository matching the package pattern wins.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | pkg | Package name, package/version or package pattern to match, i.e `foo', `foo-1.0' or `foo>=1.2'. |
[in] | reinstall | If true, package will be queued (if str matches) even if package is already installed. |
EEXIST | Package is already installed (reinstall wasn't enabled). |
ENOENT | Package not matched in repository pool. |
ENOTSUP | No repositories are available. |
EINVAL | Any other error ocurred in the process. |
Definition at line 230 of file transaction_ops.c.
References xbps_pkg_state_dictionary(), xbps_pkgdb_get_pkg(), and xbps_pkgdb_get_virtualpkg().
int xbps_transaction_prepare | ( | struct xbps_handle * | xhp | ) |
Returns the transaction dictionary, as shown above in the image. Before returning the package list is sorted in the correct order and total installed/download size for the transaction is computed.
[in] | xhp | Pointer to the xbps_handle struct. |
0 | success. |
ENXIO | if transaction dictionary and missing deps array were not created, due to xbps_transaction_install_pkg() or xbps_transaction_update_pkg() not previously called. |
ENODEV | if there are missing dependencies in transaction ("missing_deps" array of strings object in xhp->transd dictionary). |
EAGAIN | if there are package conflicts in transaction ("conflicts" array of strings object in xhp->transd dictionary). |
EINVAL | There was an error sorting packages or computing the transaction sizes. |
Definition at line 233 of file transaction_dictionary.c.
References xbps_handle::transd.
int xbps_transaction_remove_pkg | ( | struct xbps_handle * | xhp, |
const char * | pkgname, | ||
bool | recursive | ||
) |
Removes a package currently installed. The package dictionary will be added into the transaction dictionary.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | pkgname | Package name to be removed. |
[in] | recursive | If true, all packages that are currently depending on the package to be removed, and if they are orphans, will be added. |
0 | success. |
ENOENT | Package is not installed. |
EEXIST | Package has reverse dependencies. |
EINVAL | |
ENXIO | A problem ocurred in the process. |
Definition at line 250 of file transaction_ops.c.
References xbps_handle::transd, xbps_find_pkg_orphans(), xbps_pkgdb_get_pkg(), and xbps_pkgdb_get_pkg_revdeps().
int xbps_transaction_update_packages | ( | struct xbps_handle * | xhp | ) |
Finds newer versions for all installed packages by looking at the repository pool. If a newer version exists, package will be enqueued into the transaction dictionary.
[in] | xhp | Pointer to the xbps_handle struct. |
Definition at line 175 of file transaction_ops.c.
int xbps_transaction_update_pkg | ( | struct xbps_handle * | xhp, |
const char * | pkgname | ||
) |
Marks a package as "going to be updated" in the transaction dictionary. All repositories in the pool will be used, and newest version available will be enqueued if it's greater than current installed version.
[in] | xhp | Pointer to the xbps_handle struct. |
[in] | pkgname | The package name to update. |
Definition at line 224 of file transaction_ops.c.