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);
|
Resolvedeps rework
I divided resolvedeps into 2 functions. The new _alpm_resolvedep function
will resolve one dependency, for example the 'foo>=1.0-1' dependency. It
can be useful in sync_addtarget refactoring.
The resolvedeps parameters were changed, to be coherent with recursedeps:
* the target-list is an alpm_list* instead of alpm_list**. This is OK,
because alpm_list_add == alpm_list_add_last
* syncpkg param was removed. list contains the to-be-installed packages,
resolvedeps will add the required dependencies into this list
* trans param was removed, it was used in QUESTION() only, which can be used
on the main (handle->trans) transaction only (because the front-end cannot
access our pseudo-transactions at all!).
The patch fixes some wrong dynamic pmdepmissing_t usage.
I did a behavior change (and sync1003.py was modified accordingly), which
needs some explanation: The old resolvedeps didn't elect packages from
'remove' list. I've dropped this because I don't want that 2nd excluding
list param. In fact, in real life, we ~never need this rule. Resolvedeps is
called before checkconflicts, so only -Su's %REPLACES% packages are sitting
in 'remove' list. This means, that we have the replacement packages in our
target list. Usually "foo replaces bar" means, that bar isn't in our repos
any more, so resolvedeps *cannot* elect it; but usually it won't try it at
all, because foo is in the target list, and it is expected to satisfy
'bar>=1.0-1'-like dependencies too. Since checkdeps and checkconflicts is
done after resolvedeps, this cannot cause any harm.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu>
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-07-05 19:22:13 -04:00
|
|
|
pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *excluding, pmpkg_t *tpkg);
|
|
|
|
int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, alpm_list_t *list,
|
|
|
|
alpm_list_t *remove, alpm_list_t **data);
|
2008-07-01 16:53:13 -04:00
|
|
|
int _alpm_dep_edge(pmpkg_t *pkg1, pmpkg_t *pkg2);
|
2008-01-21 19:28:05 -05:00
|
|
|
pmdepend_t *_alpm_splitdep(const char *depstring);
|
2008-07-04 09:39:26 -04:00
|
|
|
pmpkg_t *_alpm_find_dep_satisfier(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: */
|