2005-03-14 20:51:43 -05:00
|
|
|
/*
|
|
|
|
* deps.h
|
2007-11-16 21:18:45 -05:00
|
|
|
*
|
2007-12-10 23:55:22 -05:00
|
|
|
* Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org>
|
2006-10-15 15:31:03 -04:00
|
|
|
* Copyright (c) 2005 by Aurelien Foret <orelien@chez.com>
|
|
|
|
* Copyright (c) 2006 by Miklos Vajna <vmiklos@frugalware.org>
|
2007-11-16 21:18:45 -05:00
|
|
|
*
|
2005-03-14 20:51:43 -05:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-12-10 23:55:22 -05:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-03-14 20:51:43 -05:00
|
|
|
*/
|
|
|
|
#ifndef _ALPM_DEPS_H
|
|
|
|
#define _ALPM_DEPS_H
|
|
|
|
|
|
|
|
#include "db.h"
|
|
|
|
#include "sync.h"
|
2006-11-22 04:03:41 -05:00
|
|
|
#include "package.h"
|
2006-11-20 04:10:23 -05:00
|
|
|
#include "alpm.h"
|
2005-03-14 20:51:43 -05:00
|
|
|
|
2006-11-20 04:10:23 -05:00
|
|
|
/* Dependency */
|
|
|
|
struct __pmdepend_t {
|
2007-01-23 22:02:53 -05:00
|
|
|
pmdepmod_t mod;
|
2008-01-11 01:01:58 -05:00
|
|
|
char *name;
|
|
|
|
char *version;
|
2006-11-20 04:10:23 -05:00
|
|
|
};
|
2005-03-29 15:31:03 -05:00
|
|
|
|
2006-11-20 04:10:23 -05:00
|
|
|
/* Missing dependency */
|
|
|
|
struct __pmdepmissing_t {
|
2008-01-11 01:01:58 -05:00
|
|
|
char *target;
|
2008-01-11 02:00:15 -05:00
|
|
|
pmdepend_t *depend;
|
2007-11-18 12:45:46 -05:00
|
|
|
char *causingpkg; /* this is used in case of remove dependency error only */
|
2006-11-20 04:10:23 -05:00
|
|
|
};
|
2005-03-29 15:31:03 -05:00
|
|
|
|
2008-01-11 02:00:15 -05:00
|
|
|
void _alpm_dep_free(pmdepend_t *dep);
|
|
|
|
pmdepend_t *_alpm_dep_dup(const pmdepend_t *dep);
|
2007-11-18 12:45:46 -05:00
|
|
|
pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdepend_t *dep,
|
|
|
|
const char *causinpkg);
|
2008-01-11 01:01:58 -05:00
|
|
|
void _alpm_depmiss_free(pmdepmissing_t *miss);
|
2008-03-16 17:36:31 -04:00
|
|
|
alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse);
|
2007-11-14 06:42:15 -05:00
|
|
|
void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit);
|
2007-01-23 22:02:53 -05:00
|
|
|
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg,
|
2008-01-21 19:28:05 -05:00
|
|
|
alpm_list_t **list, alpm_list_t *remove, pmtrans_t *trans, alpm_list_t
|
|
|
|
**data);
|
|
|
|
pmdepend_t *_alpm_splitdep(const char *depstring);
|
Cleanup usages of alpm_list_find and alpm_list_remove.
* remove obsolete and unused *_cmp helper functions like deppkg_cmp and
_alpm_grp_cmp
* new alpm_list_remove_str function, used 6 times in handle.c
* remove _alpm_prov_cmp / _alpm_db_whatprovides and replace them by
a more general alpm_find_pkg_satisfiers with a cleaner implementation.
before: alpm_db_whatprovides(db, targ)
after: alpm_find_pkg_satisfiers(alpm_db_getpkgcache(db), targ)
* remove satisfycmp and replace alpm_list_find + satisfycmp usage by
_alpm_find_dep_satisfiers.
before : alpm_list_find(_alpm_db_get_pkgcache(db), dep, satisfycmp)
after : _alpm_find_dep_satisfiers(_alpm_db_get_pkgcache(db), dep)
* remove _alpm_pkgname_pkg_cmp, which was used with alpm_list_remove, and
use _alpm_pkg_find + alpm_list_remove with _alpm_pkg_cmp instead.
This commit actually get rids of all complicated and asymmetric _cmp
functions. I first thought these functions were worth it, be caused it
allowed us to reuse list_find and list_remove. But this was at the detriment
of the clarity and also the ease of use of these functions, dangerous
because of their asymmetricity.
Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10 12:47:42 -04:00
|
|
|
alpm_list_t *_alpm_find_dep_satisfiers(alpm_list_t *pkgs, pmdepend_t *dep);
|
2005-03-14 20:51:43 -05:00
|
|
|
|
|
|
|
#endif /* _ALPM_DEPS_H */
|
|
|
|
|
|
|
|
/* vim: set ts=2 sw=2 noet: */
|