XBPS Library API  0.19
The X Binary Package System
Functions
Package registration functions

Functions

int xbps_register_pkg (struct xbps_handle *xhp, prop_dictionary_t pkg_dict, bool flush)
 
int xbps_unregister_pkg (struct xbps_handle *xhp, const char *pkgver, bool flush)
 

Detailed Description

Register and unregister packages into/from the installed packages database.

Function Documentation

int xbps_register_pkg ( struct xbps_handle xhp,
prop_dictionary_t  pkg_dict,
bool  flush 
)

Register a package into the installed packages database.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkg_dictA dictionary with the following objects: pkgname, version, pkgver, short_desc (string), automatic-install (bool) and optionally provides (array of strings).
[in]flushSet to true to make sure that pkgdb plist is written to storage on success.
Returns
0 on success, otherwise an errno value.

Definition at line 44 of file package_register.c.

References xbps_handle::flags, xbps_handle::metadir, xbps_file_hash(), xbps_pkgdb_get_pkg(), xbps_pkgdb_replace_pkg(), and xbps_xasprintf().

Referenced by xbps_transaction_commit().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int xbps_unregister_pkg ( struct xbps_handle xhp,
const char *  pkgver,
bool  flush 
)

Unregister a package from the package database.

Parameters
[in]xhpThe pointer to the xbps_handle struct.
[in]pkgverPackage name-version to match.
[in]flushSet to true to make sure that pkgdb plist is written to storage on success.
Returns
0 on success, otherwise an errno value.

Definition at line 183 of file package_register.c.

References xbps_pkgdb_remove_pkg().

Referenced by xbps_remove_pkg().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: