libalpm
Arch Linux Package Manager Library
Functions
Dependency Functions
Public API

Functions dealing with libalpm representation of dependency information. More...

Collaboration diagram for Dependency Functions:

Functions

alpm_list_talpm_checkdeps (alpm_handle_t *handle, alpm_list_t *pkglist, alpm_list_t *remove, alpm_list_t *upgrade, int reversedeps)
 Checks dependencies and returns missing ones in a list.
alpm_pkg_talpm_find_satisfier (alpm_list_t *pkgs, const char *depstring)
 Find a package satisfying a specified dependency.
alpm_pkg_talpm_find_dbs_satisfier (alpm_handle_t *handle, alpm_list_t *dbs, const char *depstring)
 Find a package satisfying a specified dependency.
alpm_list_talpm_checkconflicts (alpm_handle_t *handle, alpm_list_t *pkglist)
 Check the package conflicts in a database.
char * alpm_dep_compute_string (const alpm_depend_t *dep)
 Returns a newly allocated string representing the dependency information.

Detailed Description

Functions dealing with libalpm representation of dependency information.


Function Documentation

alpm_list_t* alpm_checkconflicts ( alpm_handle_t handle,
alpm_list_t pkglist 
)

Check the package conflicts in a database.

Parameters:
handlethe context handle
pkglistthe list of packages to check
Returns:
an alpm_list_t of alpm_conflict_t

Definition at line 209 of file conflict.c.

References _alpm_innerconflicts(), and CHECK_HANDLE.

Here is the call graph for this function:

alpm_list_t* alpm_checkdeps ( alpm_handle_t handle,
alpm_list_t pkglist,
alpm_list_t remove,
alpm_list_t upgrade,
int  reversedeps 
)

Checks dependencies and returns missing ones in a list.

Dependencies can include versions with depmod operators.

Parameters:
handlethe context handle
pkglistthe list of local packages
removean alpm_list_t* of packages to be removed
upgradean alpm_list_t* of packages to be upgraded (remove-then-upgrade)
reversedepshandles the backward dependencies
Returns:
an alpm_list_t* of alpm_depmissing_t pointers.

Definition at line 266 of file deps.c.

References _alpm_log(), _alpm_pkg_find(), alpm_dep_compute_string(), alpm_list_add(), alpm_list_free(), ALPM_LOG_DEBUG, alpm_pkg_get_depends(), CHECK_HANDLE, __alpm_list_t::data, __alpm_pkg_t::name, __alpm_list_t::next, and __alpm_pkg_t::version.

Referenced by _alpm_remove_prepare(), _alpm_resolvedeps(), and _alpm_sync_prepare().

Here is the call graph for this function:

Here is the caller graph for this function:

char* alpm_dep_compute_string ( const alpm_depend_t dep)

Returns a newly allocated string representing the dependency information.

Parameters:
depa dependency info structure
Returns:
a formatted string, e.g. "glibc>=2.12"

Returns a newly allocated string representing the dependency information.

The string must be freed!

Parameters:
depthe depend to turn into a string
Returns:
a string-formatted dependency with operator if necessary

Definition at line 820 of file deps.c.

References ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LE, ALPM_DEP_MOD_LT, ASSERT, MALLOC, _alpm_depend_t::mod, _alpm_depend_t::name, and _alpm_depend_t::version.

Referenced by _alpm_local_db_write(), _alpm_resolvedeps(), alpm_checkdeps(), cb_question(), pacman_remove(), and sync_prepare_execute().

Here is the caller graph for this function:

alpm_pkg_t* alpm_find_dbs_satisfier ( alpm_handle_t handle,
alpm_list_t dbs,
const char *  depstring 
)

Find a package satisfying a specified dependency.

First look for a literal, going through each db one by one. Then look for providers. The first satisfier found is returned. The dependency can include versions with depmod operators.

Parameters:
handlethe context handle
dbsan alpm_list_t* of alpm_db_t where the satisfier will be searched
depstringpackage or provision name, versioned or not
Returns:
a alpm_pkg_t* satisfying depstring

Definition at line 673 of file deps.c.

References _alpm_dep_free(), _alpm_splitdep(), ALPM_ERR_WRONG_ARGS, ASSERT, CHECK_HANDLE, and RET_ERR.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_pkg_t* alpm_find_satisfier ( alpm_list_t pkgs,
const char *  depstring 
)

Find a package satisfying a specified dependency.

The dependency can include versions with depmod operators.

Parameters:
pkgsan alpm_list_t* of alpm_pkg_t where the satisfier will be searched
depstringpackage or provision name, versioned or not
Returns:
a alpm_pkg_t* satisfying depstring

Definition at line 246 of file deps.c.

References _alpm_dep_free(), and _alpm_splitdep().

Referenced by pacman_deptest().

Here is the call graph for this function:

Here is the caller graph for this function: