[pacman-dev] [PATCH v2] Give the frontend control over responses for print
There are currently 8 questions that libalpm may ask the user. Each of
them has a "pacman default" and a "libalpm default". The pacman default
is the response that gets used if the user presses enter without typing
anything. Equivalently it is the response when --noconfirm is passed.
The libalpm default is what happens when --print is passed and the
question callback never even executes. This commit forces pacman to
specify responses for --print and therefore never rely on the libalpm
default. The following states how each question is handled:
ALPM_QUESTION_INSTALL_IGNOREPKG: The pacman default is 1 and the libalpm
default is 0. The latter was agreed to be a bug so we return 1 on print.
ALPM_QUESTION_REPLACE_PKG: The pacman default is 1 and the libalpm
default is 0. We return 0 on print.
ALPM_QUESTION_CONFLICT_PKG: The pacman default is 0 and the libalpm
default is 0. We return 0 on print even though print should not
encounter this.
ALPM_QUESTION_REMOVE_PKGS: The pacman default is 0 and the libalpm
default is 0. We return 0 on print.
ALPM_QUESTION_SELECT_PROVIDER: The pacman default is 0 and the libalpm
default is 0. We return 0 on print.
ALPM_QUESTION_LOCAL_NEWER: The pacman default is 1 and this is dead code
so there is no libalpm default. We return 1 on print.
ALPM_QUESTION_CORRUPTED_PKG: The pacman default is 1 and the libalpm
default is 0. We return 0 on print even though print should not
encounter this.
ALPM_QUESTION_IMPORT_KEY: The pacman default is 1 and this is dead code
so there is no libalpm default. We return 1 on print.
Signed-off-by: Connor Behan
participants (1)
-
Connor Behan