From fd8969f67875ad6854725165b9530f4be26c5d96 Mon Sep 17 00:00:00 2001 From: Nagy Gabor Date: Tue, 8 Jul 2008 10:07:05 +0200 Subject: sync_addtarget rework Now '-S provision' handling is done in the back-end. In case of multiple providers, the first one is selected (behavior change: deleted provision002.py). The old processing order was: literal, group, provision; the new one: literal, provision, group. This is more rational, but "pacman -S group" will be slower now. "pacman -S repo/provision" also works. Provision was generalized to dependencies, so you can resolve deps by hand: "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" etc. This can be useful in makepkg dependency resolving. The changes were documented in pacman manual. alpm_find_pkg_satisfiers and _alpm_find_dep_satisfiers functions were removed, since they are no longer needed. I added some verbosity to "select provider instead of literal" and "fallback to group". Signed-off-by: Nagy Gabor Signed-off-by: Dan McGee --- lib/libalpm/deps.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index ab027074..0f3f45c8 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -202,32 +202,6 @@ pmpkg_t *_alpm_find_dep_satisfier(alpm_list_t *pkgs, pmdepend_t *dep) return(NULL); } -alpm_list_t *_alpm_find_dep_satisfiers(alpm_list_t *pkgs, pmdepend_t *dep) -{ - alpm_list_t *i, *ret = NULL; - - for(i = pkgs; i; i = alpm_list_next(i)) { - pmpkg_t *pkg = i->data; - if(alpm_depcmp(pkg, dep)) { - ret = alpm_list_add(ret, pkg); - } - } - return(ret); -} - -/** Find packages in a list that provide a given package. - * @param pkgs an alpm_list_t* of package to search - * @param pkgname the name of the package - * @return an alpm_list_t* of packages that provide pkgname - */ -alpm_list_t SYMEXPORT *alpm_find_pkg_satisfiers(alpm_list_t *pkgs, const char *pkgname) -{ - pmdepend_t *dep = _alpm_splitdep(pkgname); - alpm_list_t *res = _alpm_find_dep_satisfiers(pkgs, dep); - _alpm_dep_free(dep); - return(res); -} - /** Checks dependencies and returns missing ones in a list. * Dependencies can include versions with depmod operators. * @param db pointer to the local package database @@ -567,6 +541,8 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *exclud continue; } } + _alpm_log(PM_LOG_WARNING, _("provider package was selected (%s provides %s)\n"), + pkg->name, dep->name); return(pkg); } } -- cgit v1.2.3-54-g00ecf