Package: dpkg
Version: 1.19.6

Hello,
If I specify --force-confold option to dpkg -i while upgrading /
reinstalling. Then I get the following output:

$ sudo DEBIAN_FRONTEND=noninteractive dpkg -D200 --force-confold -i teleport*deb
(Reading database ... 265903 files and directories currently installed.)
Preparing to unpack
teleport_4.0.0-rc.4-42-8_amd64_43a3d__expires-15.46pm-mon-05-aug-2019.deb
...
D000200: process_archive conffile '/etc/teleport.yaml' in package
teleport:amd64 - conff ?
D000200: pkg_conffiles_mark_old '/etc/teleport.yaml' namenode
'/etc/teleport.yaml' flags 5
Unpacking teleport (4.0.0-rc.4-42-8) over (4.0.0-rc.4-42-7) ...
D000200: conffderef in='/etc/teleport.yaml' current working='/etc/teleport.yaml'
D000200: tarobject conffile extracted
Setting up teleport (4.0.0-rc.4-42-8) ...
D000200: conffderef in='/etc/teleport.yaml' current working='/etc/teleport.yaml'
Installing new version of config file /etc/teleport.yaml ...
id@asrock-z170-ocf:~$


However there is no explanation whatsoever, being reported back to the
user, even with logging level -D200, as to why the behaviour of the
--force-confold flag is being overriden. As to why a newer config file
is being installed.

This was pretty infuriating for me today whilst testing the
correctness of my pkg. To make sure that I wasn't doing something else
wrong myself!

Wheras if the user had edited the config file, then under that other
arbitrary circumstance. Well then dpkg DOES indeed report why it's
decided to either keep or overwrite the config file. With a proper
explanation of what it's detected and what it's doing in this case it
says:


id@asrock-z170-ocf:~$ sudo nano /etc/teleport.yaml

id@asrock-z170-ocf:~$ sudo DEBIAN_FRONTEND=noninteractive dpkg -D200
--force-confold -i teleport*deb
(Reading database ... 265903 files and directories currently installed.)
Preparing to unpack
teleport_4.0.0-rc.4-42-8_amd64_065e1__expires-15.57pm-mon-05-aug-2019.deb
...
D000200: process_archive conffile '/etc/teleport.yaml' in package
teleport:amd64 - conff ?
D000200: pkg_conffiles_mark_old '/etc/teleport.yaml' namenode
'/etc/teleport.yaml' flags 5
Unpacking teleport (4.0.0-rc.4-42-8) over (4.0.0-rc.4-42-8) ...
D000200: conffderef in='/etc/teleport.yaml' current working='/etc/teleport.yaml'
D000200: tarobject conffile extracted
Setting up teleport (4.0.0-rc.4-42-8) ...
D000200: conffderef in='/etc/teleport.yaml' current working='/etc/teleport.yaml'

Configuration file '/etc/teleport.yaml'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Using current old file as you requested.

This (to me) is an inconsistent behaviour and should be rectified in
the first instance to add more message or logging lines in a similar
fashion to the 2nd case (except to say the opposite, why it's
overwriting the config file despite the --force-confold flag being
specified!)

So I suggest that some additional output string(s), be added, to say:

D000200: conffderef in='/etc/teleport.yaml' current working='/etc/teleport.yaml'
Configuration file '/etc/teleport.yaml'
 ==> Not modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
 ==> Overriding --force-confold flag, since no user modification(s) to preserve.
 Installing new version of config file /etc/teleport.yaml ...

====
end of suggestions


Hope the reasons for this request are clear. Please do as per your liking.
Kind Regards / Hava a good day


Dreamcat4
dreamc...@gmail.com

Reply via email to