Hi! On Tue, 2024-12-31 at 11:33:42 +0000, Mark Hindley wrote: > I have a patch to support DPKG_FORCE (see attached). However, I am > still unsure of the best way to handle the case of conflicting > UCF_FORCE_CONFF* and dpkg --force-conf* options.
I think the general expectation is that CLI options always override environment variables, which then override configuration file settings. So in this case given that the dpkg environment variables are going to be exposing what got passed through the CLI options, I'd say it makes sense to make those override any ucf specific ones? I guess the problem is that it will not always be clear whether the variables were set manually or via CLI options to dpkg. I think if that distinction was more clear, then perhaps there could be an argument for denoting the ucf environment variables (which are more specific than the dpkg ones) to imply that they override them (like with say DPKG_EDITOR vs EDITOR). > It seems sane that both the command line and environment should > override what is in /etc/ucf.conf. However, given Yes. > UCF_FORCE_CONFFOLD=1 dpkg --force-confnew ... > > which should take precedent? IMO in this specific case it seems clear to me that the CLI options should win, because they are more explicit than the environment variables which could have been set in the environment globally. Thanks, Guillem

