Add interactive provider selection
commit4097c98c1ee65d6b3a659d042c6c84e0632673bf
authorXavier Chantry <chantry.xavier@gmail.com>
Sat, 16 Oct 2010 10:28:01 +0000 (16 12:28 +0200)
committerXavier Chantry <chantry.xavier@gmail.com>
Sat, 29 Jan 2011 18:33:15 +0000 (29 19:33 +0100)
tree2468e89522839b9e2d8f66cddc11c23076c8be0a
parentba97a22ce10df2966a9e1117b48a84b93eae0538
Add interactive provider selection

If there are multiple providers in one db, pacman used to just stop at
the first one (both during dependency resolution or for pacman -S
'provision' which uses the same code).

This adds a new conversation callback so that the user can choose which
provider to install. By default (user press enter or --noconfirm), the
first provider is still chosen, so for example the behavior of sync402
and 403 is preserved. But at least the user now has the possibility to
make the right choice in a manual run.

If one of the provider is already installed, it is picked for
reinstall/upgrade, so that provision 002/003 pactest now pass.

$ pacman -S community/smtp-server
:: There are 3 providers available for smtp-server:
   1) courier-mta  2) esmtp  3) exim

Which one do you want to install?
Enter a number (default=1):

Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com>
lib/libalpm/alpm.h
lib/libalpm/deps.c
src/pacman/callback.c
src/pacman/util.c
src/pacman/util.h
test/pacman/tests/provision002.py
test/pacman/tests/provision003.py