alpm_api_depends(3)

NAME
alpm_api_depends - Functions dealing with libalpm representation of dependency information.

SYNOPSIS

  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

  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_list_add(), alpm_pkg_find(), __alpm_list_t::data, and __alpm_list_t::next.

  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.

  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_free(), alpm_list_remove_item(), alpm_pkg_get_depends(), __alpm_list_t::data, and __alpm_list_t::next.

Referenced by alpm_dep_from_string(), and alpm_find_satisfier().

  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_pkg_find(), alpm_pkg_get_reason(), and ALPM_PKG_REASON_EXPLICIT.

Referenced by 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

  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.