alpm_api_depends man page

alpm_api_depends — Dependency Functions

Functions dealing with libalpm representation of dependency information.

Functions

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.
alpm_pkg_t * alpm_find_satisfier (alpm_list_t *pkgs, const char *depstring)
Find a package satisfying a specified dependency.
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.
alpm_list_t * alpm_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.
alpm_depend_t * alpm_dep_from_string (const char *depstring)
Return a newly allocated dependency information parsed from a string.
void alpm_dep_free (alpm_depend_t *dep)
Free a dependency info structure.

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:

handle the context handle
pkglist the list of packages to check

Returns:

an alpm_list_t of alpm_conflict_t

References alpm_db_get_pkgcache(), alpm_filelist_contains(), alpm_list_add(), alpm_list_copy(), alpm_list_count(), alpm_list_diff(), alpm_list_free(), alpm_list_free_inner(), alpm_list_join(), alpm_pkg_get_files(), ALPM_TRANS_FLAG_FORCE, __alpm_list_t::data, and __alpm_list_t::next.

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

Checks dependencies and returns missing ones in a list. Dependencies can include versions with depmod operators.

Parameters:

handle the context handle
pkglist the list of local packages
remove an alpm_list_t* of packages to be removed
upgrade an alpm_list_t* of packages to be upgraded (remove-then-upgrade)
reversedeps handles the backward dependencies

Returns:

an alpm_list_t* of alpm_depmissing_t pointers.

References alpm_dep_compute_string(), ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LE, ALPM_DEP_MOD_LT, alpm_list_add(), alpm_list_free(), alpm_pkg_find(), alpm_pkg_get_depends(), alpm_pkg_get_provides(), alpm_pkg_vercmp(), __alpm_list_t::data, and __alpm_list_t::next.

Referenced by alpm_find_dbs_satisfier(), alpm_find_group_pkgs(), and alpm_remove_pkg().

char* alpm_dep_compute_string (const alpm_depend_t * dep)

Returns a newly allocated string representing the dependency information.

Parameters:

dep a 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:

dep the depend to turn into a string

Returns:

a string-formatted dependency with operator if necessary

References ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LE, and ALPM_DEP_MOD_LT.

Referenced by alpm_checkdeps(), and alpm_find_dbs_satisfier().

void alpm_dep_free (alpm_depend_t * dep)

Free a dependency info structure.

Parameters:

dep struct to free

References alpm_db_get_pkgcache(), alpm_list_add(), alpm_list_diff(), alpm_list_find_ptr(), alpm_list_free(), alpm_list_free_inner(), alpm_list_remove_item(), alpm_list_reverse(), alpm_pkg_get_depends(), ALPM_TRANS_FLAG_NODEPVERSION, __alpm_list_t::data, and __alpm_list_t::next.

Referenced by alpm_dep_from_string(), alpm_find_dbs_satisfier(), alpm_find_group_pkgs(), alpm_find_satisfier(), alpm_option_set_usesyslog(), and alpm_pkg_compute_optionalfor().

alpm_depend_t* alpm_dep_from_string (const char * depstring)

Return a newly allocated dependency information parsed from a string.

Parameters:

depstring a formatted string, e.g. 'glibc=2.12'

Returns:

a dependency info structure

References alpm_dep_free(), ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LE, ALPM_DEP_MOD_LT, alpm_list_add(), alpm_list_count(), alpm_list_free(), alpm_list_nth(), alpm_pkg_find(), alpm_pkg_get_reason(), ALPM_PKG_REASON_EXPLICIT, alpm_pkg_should_ignore(), __alpm_list_t::data, _alpm_question_install_ignorepkg_t::install, __alpm_list_t::next, _alpm_question_install_ignorepkg_t::type, _alpm_question_select_provider_t::type, and _alpm_question_select_provider_t::use_index.

Referenced by alpm_find_dbs_satisfier(), alpm_find_group_pkgs(), and alpm_find_satisfier().

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:

handle the context handle
dbs an alpm_list_t* of alpm_db_t where the satisfier will be searched
depstring package or provision name, versioned or not

Returns:

a alpm_pkg_t* satisfying depstring

References alpm_checkdeps(), alpm_dep_compute_string(), alpm_dep_free(), alpm_dep_from_string(), alpm_list_add(), alpm_list_copy(), alpm_list_free(), alpm_pkg_find(), __alpm_list_t::data, and __alpm_list_t::next.

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:

pkgs an alpm_list_t* of alpm_pkg_t where the satisfier will be searched
depstring package or provision name, versioned or not

Returns:

a alpm_pkg_t* satisfying depstring

References alpm_dep_free(), and alpm_dep_from_string().

Author

Generated automatically by Doxygen for libalpm from the source code.

Info

Thu Mar 31 2016 libalpm