Nagy Gabor wrote:
From 6541daa508b3f4d050db61f7212fcedf45ab0120 Mon Sep 17 00:00:00 2001 From: Nagy Gabor <ngaba@bibl.u-szeged.hu> Date: Sat, 5 Jul 2008 12:53:55 +0200 Subject: [PATCH] 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. Now "pacman -S repo/provision" also works. Provision was generalized to dependencies, so "pacman -S 'bash>2.0'" or "pacman -S 'core/bash>2.0'" also works; this can be useful in makepkg dependency resolving.
Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> --- lib/libalpm/deps.c | 19 +++++++++-- lib/libalpm/sync.c | 68 +++++++++++++++-------------------------- pactest/tests/provision002.py | 15 --------- src/pacman/sync.c | 38 ++--------------------- 4 files changed, 43 insertions(+), 97 deletions(-) delete mode 100644 pactest/tests/provision002.py
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 1a6da96..e042166 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -544,8 +544,14 @@ pmpkg_t *_alpm_resolvedep(pmdepend_t *dep, alpm_list_t *dbs, alpm_list_t *exclud if(pkg && alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) { if(_alpm_pkg_should_ignore(pkg)) { int install; - QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, tpkg, - pkg, NULL, &install); + /* wow, we have a very stupid callback API here */ + if(tpkg) { + QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, tpkg, + pkg, NULL, &install); + } else { + QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, + NULL, NULL, &install); + } if(!install) { continue; }
I already discussed this with Nagy on irc, but just a quick comment here for others : this part doesn't seem to fit well here, and could also be handled more nicely by simply using a smarter order of the optional data parameters (pkg,tpkg and pkg,NULL instead of tpkg,pkg and pkg,NULL).