XBPS Library API 20240111
The X Binary Package System
Enumerations | Functions
Package state handling functions

Enumerations

enum  pkg_state_t
 

Functions

int xbps_pkg_state_installed (struct xbps_handle *xhp, const char *pkgname, pkg_state_t *state)
 
int xbps_pkg_state_dictionary (xbps_dictionary_t dict, pkg_state_t *state)
 
int xbps_set_pkg_state_installed (struct xbps_handle *xhp, const char *pkgver, pkg_state_t state)
 
int xbps_set_pkg_state_dictionary (xbps_dictionary_t dict, pkg_state_t state)
 

Detailed Description

Enumeration Type Documentation

◆ pkg_state_t

Integer representing a state on which a package may be. Possible values for this are:

  • XBPS_PKG_STATE_UNPACKED: Package has been unpacked correctly but has not been configured due to unknown reasons.
  • XBPS_PKG_STATE_INSTALLED: Package has been installed successfully.
  • XBPS_PKG_STATE_BROKEN: not yet used.
  • XBPS_PKG_STATE_HALF_REMOVED: Package has been removed but not completely: the purge action in REMOVE script wasn't executed, pkg metadata directory still exists and is registered in package database.
  • XBPS_PKG_STATE_NOT_INSTALLED: Package going to be installed in a transaction dictionary but that has not been yet unpacked.

Definition at line 1768 of file xbps.h.

Function Documentation

◆ xbps_pkg_state_installed()

int xbps_pkg_state_installed ( struct xbps_handle xhp,
const char *  pkgname,
pkg_state_t state 
)

Gets package state from package pkgname, and sets its state into state.

Parameters
[in]xhpThe pointer to an xbps_handle struct.
[in]pkgnamePackage name.
[out]statePackage state returned.
Returns
0 on success, otherwise an errno value.

Definition at line 95 of file package_state.c.

References xbps_pkgdb_get_pkg().

Here is the call graph for this function:

◆ xbps_pkg_state_dictionary()

int xbps_pkg_state_dictionary ( xbps_dictionary_t  dict,
pkg_state_t state 
)

Gets package state from a package dictionary dict, and sets its state into state.

Parameters
[in]dictPackage dictionary.
[out]statePackage state returned.
Returns
0 on success, otherwise an errno value.

Definition at line 116 of file package_state.c.

Referenced by xbps_configure_pkg(), and xbps_pkg_is_installed().

Here is the caller graph for this function:

◆ xbps_set_pkg_state_installed()

int xbps_set_pkg_state_installed ( struct xbps_handle xhp,
const char *  pkgver,
pkg_state_t  state 
)

Sets package state state in package pkgname.

Parameters
[in]xhpThe pointer to an xbps_handle struct.
[in]pkgverPackage name/version to match.
[in]statePackage state to be set.
Returns
0 on success, otherwise an errno value.

Definition at line 136 of file package_state.c.

References xbps_handle::pkgdb, xbps_pkg_name(), and xbps_pkgdb_get_pkg().

Here is the call graph for this function:

◆ xbps_set_pkg_state_dictionary()

int xbps_set_pkg_state_dictionary ( xbps_dictionary_t  dict,
pkg_state_t  state 
)

Sets package state state in package dictionary dict.

Parameters
[in]dictPackage dictionary.
[in]statePackage state to be set.
Returns
0 on success, otherwise an errno value.

Definition at line 128 of file package_state.c.

Referenced by xbps_configure_pkg().

Here is the caller graph for this function: