libalpm
Arch Linux Package Manager Library
Functions
deps.c File Reference
#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"
Include dependency graph for deps.c:

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_talpm_find_satisfier (alpm_list_t *pkgs, const char *depstring)
 Find a package satisfying a specified dependency.
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.
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_talpm_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.

Function Documentation

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
dbpackage database to do dependency tracing in
*targspointer to a list of packages
include_explicitif 0, explicitly installed packages are not included
Returns:
0 on success, -1 on errors

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
handlethe context handle
localpkgsis the list of local packages
pkgis the package to resolve
preferredpackages to prefer when resolving
packagesis 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
removeis the set of packages which will be removed in this transaction
datareturns the dependency which could not be satisfied in the event of an error
Returns:
0 on success, with [pkg] and all of its dependencies not already on the [*packages] list added to that list, or -1 on failure due to an unresolvable dependency, in which case the [*packages] list will be unmodified by this function

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().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* _alpm_sortbydeps ( alpm_handle_t handle,
alpm_list_t targets,
int  reverse 
)
alpm_depend_t* _alpm_splitdep ( const char *  depstring)