deps.c File Reference

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "deps.h"
#include "alpm_list.h"
#include "util.h"
#include "log.h"
#include "error.h"
#include "package.h"
#include "db.h"
#include "cache.h"
#include "handle.h"

Include dependency graph for deps.c:

Go to the source code of this file.

Functions

void _alpm_dep_free (pmdepend_t *dep)
pmdepmissing_t_alpm_depmiss_new (const char *target, pmdepend_t *dep)
void _alpm_depmiss_free (pmdepmissing_t *miss)
alpm_list_t_alpm_sortbydeps (alpm_list_t *targets, pmtranstype_t mode)
alpm_list_talpm_checkdeps (pmdb_t *db, int reversedeps, alpm_list_t *remove, alpm_list_t *upgrade)
int alpm_depcmp (pmpkg_t *pkg, pmdepend_t *dep)
pmdepend_talpm_splitdep (const char *depstring)
pmdepend_t_alpm_dep_dup (const pmdepend_t *dep)
void _alpm_recursedeps (pmdb_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.
int _alpm_resolvedeps (pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, alpm_list_t **list, alpm_list_t *remove, pmtrans_t *trans, alpm_list_t **data)
const char * alpm_miss_get_target (const pmdepmissing_t *miss)
pmdepend_talpm_miss_get_dep (pmdepmissing_t *miss)
pmdepmod_t alpm_dep_get_mod (const pmdepend_t *dep)
const char * alpm_dep_get_name (const pmdepend_t *dep)
const char * alpm_dep_get_version (const pmdepend_t *dep)
char * alpm_dep_get_string (const pmdepend_t *dep)


Function Documentation

pmdepend_t* _alpm_dep_dup ( const pmdepend_t dep  ) 

Definition at line 420 of file deps.c.

References CALLOC, __pmdepend_t::mod, __pmdepend_t::name, PM_ERR_MEMORY, RET_ERR, STRDUP, and __pmdepend_t::version.

Referenced by _alpm_depmiss_new(), and _alpm_pkg_dup().

Here is the caller graph for this function:

void _alpm_dep_free ( pmdepend_t dep  ) 

Definition at line 39 of file deps.c.

References FREE, __pmdepend_t::name, and __pmdepend_t::version.

Referenced by _alpm_depmiss_free(), and _alpm_pkg_free().

Here is the caller graph for this function:

void _alpm_depmiss_free ( pmdepmissing_t miss  ) 

Definition at line 85 of file deps.c.

References _alpm_dep_free(), __pmdepmissing_t::depend, FREE, and __pmdepmissing_t::target.

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

Here is the call graph for this function:

Here is the caller graph for this function:

pmdepmissing_t* _alpm_depmiss_new ( const char *  target,
pmdepend_t dep 
)

Definition at line 71 of file deps.c.

References _alpm_dep_dup(), ALPM_LOG_FUNC, __pmdepmissing_t::depend, MALLOC, PM_ERR_MEMORY, RET_ERR, STRDUP, and __pmdepmissing_t::target.

Referenced by alpm_checkdeps().

Here is the call graph for this function:

Here is the caller graph for this function:

void _alpm_recursedeps ( pmdb_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:
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 485 of file deps.c.

References _alpm_db_get_pkgcache(), _alpm_log(), _alpm_pkg_dup(), alpm_depcmp(), alpm_list_add(), ALPM_LOG_FUNC, alpm_pkg_get_depends(), alpm_pkg_get_name(), __alpm_list_t::data, __alpm_list_t::next, and PM_LOG_DEBUG.

Referenced by _alpm_remove_prepare().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_resolvedeps ( pmdb_t local,
alpm_list_t dbs_sync,
pmpkg_t syncpkg,
alpm_list_t **  list,
alpm_list_t remove,
pmtrans_t trans,
alpm_list_t **  data 
)

Definition at line 520 of file deps.c.

References _, _alpm_db_get_pkgcache(), _alpm_db_get_pkgfromcache(), _alpm_depmiss_free(), _alpm_log(), _alpm_pkg_find(), _alpm_pkg_free(), _alpm_pkg_new(), _alpm_pkg_should_ignore(), _alpm_resolvedeps(), alpm_checkdeps(), alpm_dep_get_string(), alpm_depcmp(), alpm_list_add(), alpm_list_free(), alpm_list_free_inner(), ALPM_LOG_FUNC, alpm_miss_get_dep(), alpm_pkg_get_name(), __alpm_list_t::data, FREELIST, MALLOC, __pmpkg_t::name, __pmdepend_t::name, __alpm_list_t::next, PM_ERR_MEMORY, PM_ERR_UNSATISFIED_DEPS, pm_errno, PM_LOG_DEBUG, PM_LOG_ERROR, PM_TRANS_CONV_INSTALL_IGNOREPKG, QUESTION, and __pmdepmissing_t::target.

Referenced by _alpm_resolvedeps(), and _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_list_t targets,
pmtranstype_t  mode 
)

Definition at line 146 of file deps.c.

References _, _alpm_log(), alpm_list_add(), alpm_list_free(), alpm_list_free_inner(), alpm_list_reverse(), ALPM_LOG_FUNC, __pmgraph_t::childptr, __pmgraph_t::data, __alpm_list_t::data, __pmpkg_t::name, __alpm_list_t::next, __pmgraph_t::parent, PM_LOG_DEBUG, PM_LOG_WARNING, PM_TRANS_TYPE_REMOVE, and __pmgraph_t::state.

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

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* alpm_checkdeps ( pmdb_t db,
int  reversedeps,
alpm_list_t remove,
alpm_list_t upgrade 
)

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

Parameters:
db pointer to the local package database
reversedeps handles the backward dependencies
remove an alpm_list_t* of packages to be removed
upgrade an alpm_list_t* of packages to be upgraded (remove-then-upgrade)
Returns:
an alpm_list_t* of pmpkg_t* of missing_t pointers.

Definition at line 234 of file deps.c.

References _alpm_db_get_pkgcache(), _alpm_depmiss_new(), _alpm_log(), _alpm_pkg_cmp(), alpm_dep_get_string(), alpm_list_add(), alpm_list_copy(), alpm_list_find(), alpm_list_free(), alpm_list_join(), ALPM_LOG_FUNC, alpm_pkg_get_depends(), alpm_pkg_get_name(), alpm_pkg_get_version(), __alpm_list_t::data, __pmpkg_t::name, __alpm_list_t::next, and PM_LOG_DEBUG.

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

Here is the call graph for this function:

Here is the caller graph for this function:

pmdepmod_t alpm_dep_get_mod ( const pmdepend_t dep  ) 

Definition at line 663 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, and __pmdepend_t::mod.

const char* alpm_dep_get_name ( const pmdepend_t dep  ) 

Definition at line 673 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, and __pmdepend_t::name.

Referenced by pacman_deptest().

Here is the caller graph for this function:

char* alpm_dep_get_string ( const pmdepend_t dep  ) 

Reverse of splitdep; make a dep string from a pmdepend_t struct. The string must be freed!

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

Definition at line 698 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, MALLOC, __pmdepend_t::mod, __pmdepend_t::name, PM_DEP_MOD_ANY, PM_DEP_MOD_EQ, PM_DEP_MOD_GE, PM_DEP_MOD_GT, PM_DEP_MOD_LE, PM_DEP_MOD_LT, PM_ERR_MEMORY, RET_ERR, and __pmdepend_t::version.

Referenced by _alpm_db_write(), _alpm_resolvedeps(), alpm_checkdeps(), dump_pkg_full(), main(), pacman_add(), and pacman_remove().

Here is the caller graph for this function:

const char* alpm_dep_get_version ( const pmdepend_t dep  ) 

Definition at line 683 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, and __pmdepend_t::version.

int alpm_depcmp ( pmpkg_t pkg,
pmdepend_t dep 
)

Definition at line 332 of file deps.c.

References ALPM_LOG_FUNC, alpm_pkg_get_name(), alpm_pkg_get_provides(), alpm_pkg_get_version(), __alpm_list_t::data, __pmdepend_t::mod, __pmdepend_t::name, __alpm_list_t::next, PM_DEP_MOD_ANY, and __pmdepend_t::version.

Referenced by _alpm_recursedeps(), _alpm_resolvedeps(), alpm_pkg_compute_requiredby(), and pacman_deptest().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdepend_t* alpm_miss_get_dep ( pmdepmissing_t miss  ) 

Definition at line 653 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, and __pmdepmissing_t::depend.

Referenced by _alpm_resolvedeps(), main(), pacman_add(), and pacman_remove().

Here is the caller graph for this function:

const char* alpm_miss_get_target ( const pmdepmissing_t miss  ) 

Definition at line 643 of file deps.c.

References ALPM_LOG_FUNC, ASSERT, and __pmdepmissing_t::target.

Referenced by main(), pacman_add(), and pacman_remove().

Here is the caller graph for this function:

pmdepend_t* alpm_splitdep ( const char *  depstring  ) 

Definition at line 367 of file deps.c.

References CALLOC, __pmdepend_t::mod, __pmdepend_t::name, PM_DEP_MOD_ANY, PM_DEP_MOD_EQ, PM_DEP_MOD_GE, PM_DEP_MOD_GT, PM_DEP_MOD_LE, PM_DEP_MOD_LT, PM_ERR_MEMORY, RET_ERR, STRDUP, and __pmdepend_t::version.

Referenced by _alpm_db_read(), and pacman_deptest().

Here is the caller graph for this function:


Generated on Mon Jan 14 23:56:52 2008 for libalpm by  doxygen 1.5.4