Re-add the non-user friendly --ask option
commit90e3e026d1236ad89c142b427d7eeb842bbb7ff4
authorXavier Chantry <shiningxc@gmail.com>
Mon, 31 Aug 2009 18:17:05 +0000 (31 20:17 +0200)
committerDan McGee <dan@archlinux.org>
Wed, 9 Sep 2009 03:02:08 +0000 (8 22:02 -0500)
tree2afa66bf7e7ce4358318710abcf606c952c4af8b
parent12b55958d8884bd6828e0888ab9dc10d38bcd72f
Re-add the non-user friendly --ask option

This re-implements the --ask option which was removed in commit
1ff8e7f364a9f640ada7526384646d510ac29967.

This option does not have to be exposed to the user (help,doc,etc), but is
very very useful for pactest if we want to have more coverage there.

This was rewritten in a smarter way, without code duplication. And with a
different behavior : this option is now only used to inverse default
behavior to questions.

We still use bit operations based on the following struct :
/* Transaction Conversations (ie, questions) */
typedef enum _pmtransconv_t {
        PM_TRANS_CONV_INSTALL_IGNOREPKG = 0x01,
        PM_TRANS_CONV_REPLACE_PKG = 0x02,
        PM_TRANS_CONV_CONFLICT_PKG = 0x04,
        PM_TRANS_CONV_CORRUPTED_PKG = 0x08,
        PM_TRANS_CONV_LOCAL_NEWER = 0x10,
        PM_TRANS_CONV_REMOVE_PKGS = 0x20,
} pmtransconv_t;

for each conv matched, the default answer is inversed.

--ask 0 : all default answers are preserved
--ask 4 : only conflict question is inversed
--ask 63 : all questions are inversed (63 == 1+2+4+8+16+32)

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
src/pacman/callback.c
src/pacman/conf.h
src/pacman/pacman.c