libalpm
Arch Linux Package Manager Library
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "deps.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "graph.h"
#include "package.h"
#include "db.h"
#include "handle.h"
#include "trans.h"
Go to the source code of this file.
Functions | |
void | _alpm_dep_free (alpm_depend_t *dep) |
void | _alpm_depmiss_free (alpm_depmissing_t *miss) |
alpm_list_t * | _alpm_sortbydeps (alpm_handle_t *handle, alpm_list_t *targets, int reverse) |
alpm_pkg_t * | alpm_find_satisfier (alpm_list_t *pkgs, const char *depstring) |
Find a package satisfying a specified dependency. | |
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. | |
int | _alpm_depcmp_literal (alpm_pkg_t *pkg, alpm_depend_t *dep) |
int | _alpm_depcmp (alpm_pkg_t *pkg, alpm_depend_t *dep) |
alpm_depend_t * | _alpm_splitdep (const char *depstring) |
alpm_depend_t * | _alpm_dep_dup (const alpm_depend_t *dep) |
int | _alpm_recursedeps (alpm_db_t *db, alpm_list_t *targs, int include_explicit) |
Adds unneeded dependencies to an existing list of packages. | |
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. | |
int | _alpm_resolvedeps (alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t *pkg, alpm_list_t *preferred, alpm_list_t **packages, alpm_list_t *remove, alpm_list_t **data) |
Computes resolvable dependencies for a given package and adds that package and those resolvable dependencies to a list. | |
char * | alpm_dep_compute_string (const alpm_depend_t *dep) |
Reverse of splitdep; make a dep string from a alpm_depend_t struct. |
alpm_depend_t* _alpm_dep_dup | ( | const alpm_depend_t * | dep | ) |
Definition at line 463 of file deps.c.
References CALLOC, _alpm_depend_t::mod, _alpm_depend_t::name, _alpm_depend_t::name_hash, STRDUP, and _alpm_depend_t::version.
void _alpm_dep_free | ( | alpm_depend_t * | dep | ) |
Definition at line 38 of file deps.c.
References FREE, _alpm_depend_t::name, and _alpm_depend_t::version.
Referenced by _alpm_depmiss_free(), _alpm_sync_prepare(), alpm_find_dbs_satisfier(), and alpm_find_satisfier().
int _alpm_depcmp | ( | alpm_pkg_t * | pkg, |
alpm_depend_t * | dep | ||
) |
Definition at line 379 of file deps.c.
References _alpm_depcmp_literal(), ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, alpm_pkg_get_provides(), __alpm_list_t::data, _alpm_depend_t::mod, _alpm_depend_t::name, _alpm_depend_t::name_hash, __alpm_list_t::next, and _alpm_depend_t::version.
Referenced by _alpm_sync_prepare().
int _alpm_depcmp_literal | ( | alpm_pkg_t * | pkg, |
alpm_depend_t * | dep | ||
) |
Definition at line 369 of file deps.c.
References _alpm_depend_t::mod, __alpm_pkg_t::name, _alpm_depend_t::name, __alpm_pkg_t::name_hash, _alpm_depend_t::name_hash, __alpm_pkg_t::version, and _alpm_depend_t::version.
Referenced by _alpm_depcmp().
void _alpm_depmiss_free | ( | alpm_depmissing_t * | miss | ) |
Definition at line 59 of file deps.c.
References _alpm_dep_free(), _alpm_depmissing_t::causingpkg, _alpm_depmissing_t::depend, FREE, and _alpm_depmissing_t::target.
Referenced by _alpm_remove_prepare(), _alpm_resolvedeps(), and _alpm_sync_prepare().
int _alpm_recursedeps | ( | alpm_db_t * | db, |
alpm_list_t * | targs, | ||
int | include_explicit | ||
) |
Adds unneeded dependencies to an existing list of packages.
By unneeded, we mean dependencies that are only required by packages in the target list, so they can be safely removed. If the input list was topo sorted, the output list will be topo sorted too.
db | package database to do dependency tracing in |
*targs | pointer to a list of packages |
include_explicit | if 0, explicitly installed packages are not included |
Definition at line 527 of file deps.c.
References _alpm_db_get_pkgcache(), _alpm_log(), _alpm_pkg_dup(), alpm_list_add(), ALPM_LOG_DEBUG, __alpm_list_t::data, __alpm_db_t::handle, __alpm_pkg_t::name, and __alpm_list_t::next.
Referenced by _alpm_remove_prepare().
int _alpm_resolvedeps | ( | alpm_handle_t * | handle, |
alpm_list_t * | localpkgs, | ||
alpm_pkg_t * | pkg, | ||
alpm_list_t * | preferred, | ||
alpm_list_t ** | packages, | ||
alpm_list_t * | remove, | ||
alpm_list_t ** | data | ||
) |
Computes resolvable dependencies for a given package and adds that package and those resolvable dependencies to a list.
handle | the context handle |
localpkgs | is the list of local packages |
pkg | is the package to resolve |
preferred | packages to prefer when resolving |
packages | is a pointer to a list of packages which will be searched first for any dependency packages needed to complete the resolve, and to which will be added any [pkg] and all of its dependencies not already on the list |
remove | is the set of packages which will be removed in this transaction |
data | returns the dependency which could not be satisfied in the event of an error |
Definition at line 710 of file deps.c.
References _, _alpm_db_get_pkgfromcache(), _alpm_depmiss_free(), _alpm_log(), _alpm_pkg_compare_versions(), _alpm_pkg_find(), alpm_checkdeps(), alpm_dep_compute_string(), ALPM_ERR_UNSATISFIED_DEPS, alpm_list_add(), alpm_list_copy(), alpm_list_free(), alpm_list_last(), alpm_list_remove_item(), ALPM_LOG_DEBUG, ALPM_LOG_WARNING, ALPM_TRANS_FLAG_NEEDED, ALPM_TRANS_FLAG_RECURSE, __alpm_list_t::data, __alpm_handle_t::db_local, __alpm_handle_t::dbs_sync, _alpm_depmissing_t::depend, __alpm_trans_t::flags, __alpm_pkg_t::name, __alpm_list_t::next, __alpm_handle_t::pm_errno, __alpm_handle_t::trans, and __alpm_pkg_t::version.
Referenced by _alpm_sync_prepare().
alpm_list_t* _alpm_sortbydeps | ( | alpm_handle_t * | handle, |
alpm_list_t * | targets, | ||
int | reverse | ||
) |
Definition at line 127 of file deps.c.
References _, _alpm_graph_free(), _alpm_log(), alpm_list_add(), alpm_list_free(), alpm_list_free_inner(), alpm_list_reverse(), ALPM_LOG_DEBUG, ALPM_LOG_WARNING, __alpm_graph_t::childptr, __alpm_graph_t::data, __alpm_list_t::data, __alpm_pkg_t::name, __alpm_list_t::next, __alpm_graph_t::parent, and __alpm_graph_t::state.
Referenced by _alpm_remove_prepare(), and _alpm_sync_prepare().
alpm_depend_t* _alpm_splitdep | ( | const char * | depstring | ) |
Definition at line 407 of file deps.c.
References _alpm_hash_sdbm(), ALPM_DEP_MOD_ANY, ALPM_DEP_MOD_EQ, ALPM_DEP_MOD_GE, ALPM_DEP_MOD_GT, ALPM_DEP_MOD_LE, ALPM_DEP_MOD_LT, MALLOC, _alpm_depend_t::mod, _alpm_depend_t::name, _alpm_depend_t::name_hash, STRDUP, STRNDUP, and _alpm_depend_t::version.
Referenced by _alpm_sync_prepare(), alpm_find_dbs_satisfier(), and alpm_find_satisfier().