[pacman-dev] Providing a better way for users to answer "yes" to a specific, focused question

Charles Duffy charles at dyfis.net
Tue Apr 7 17:10:19 UTC 2015


Howdy --

Right now, the common practice for users wishing to automate an answer
of "yes" to ALPM_QUESTION_CONFLICT_PKG, ALPM_QUESTION_REPLACE_PKG,
ALPM_QUESTION_REMOVE_PKGS, ALPM_QUESTION_CORRUPTED_PKG,
ALPM_QUESTION_IMPORT_KEY or similar is to pipe from "yes".

This has the side effect of not overriding only the single, desired
option, but overriding answers for the entire set of questions --
including others which the user may not intend.

While I understand the intent to encourage human involvement in
deciding to take actions that could easily result in a broken system,
if users _are_ going to automate such acts, it would be appropriate to
provide a supported means of doing so as specific as possible.


As such, I'd like to propose one of the following:

- [Most limited to my immediate purpose, already implemented in my
local tree]: Adding a --remove-conflicted option which makes
ALPM_QUESTION_CONFLICT_PKG automatically answered "yes"

- [Somewhat more general]: Adding a set of related options:
--answer-{conflict,replace,remove,corrupted,import-key}={yes,no}. Not
ideal, since some of these situations (particularly import-key) may be
best handled with information specific to the item at hand.

- Add a set of environment variables:
  PACMAN_QUESTION_{CONFLICT,REPLACE,REMOVE,CORRUPTED,IMPORTKEY}{,_$VALUE}={yes,no}
  In this proposal, a user could set
PACMAN_QUESTION_IMPORTKEY_abcdefg=yes, and allow only that one key --
or PACMAN_QUESTION_IMPORTKEY=yes if they're exceptionally reckless and
want to import all keys. Similarly, PACMAN_QUESTION_CONFLICT=yes to
allow all conflicts to be resolved by removing a package, or
PACMAN_QUESTION_CONFLICT_foo to allow conflicts over package foo to be
resolved by removing that package.

Would any of these, if implemented and adjusted per feedback, be
likely to be considered for merge?

Thanks!


More information about the pacman-dev mailing list