#994903 remove-on-upgrade breaks packages replacing conffiles by non-conffile

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Christoph Berg
Date:
2021-09-23 05:27:02 UTC
Severity:
normal
#994903#3
Date:
2021-09-22 22:20:05 UTC
From:
To:
Hi,

the new remove-on-upgrade logic from #822462 breaks the use-case of
replacing a conffile by a non-conffile version.

In postgresql-common, I'm trying to remove
/etc/apt/apt.conf.d/01autoremove-postgresql as a conffile, while still
generating that file from the package postinst. That worked[*] since
debian/postgresql-common.maintscript knows in which previous package
versions to trigger the logic, and the logic fires only once.

The same workflow happens for everyone moving from conffile to ucf.

The new logic does not know on which previous package versions to
trigger, and triggers always instead, and worse, it even triggers if
the file is no longer a conffile, but has been properly regenerated.
That means, on each package installation, I'm seeing this:

Setting up postgresql-common (229) ...
Obsolete conffile '/etc/apt/apt.conf.d/01autoremove-postgresql' has been modified by you.
Saving as /etc/apt/apt.conf.d/01autoremove-postgresql.dpkg-old ...

Is the answer here that I should keep the conffile flag around even if
the package isn't shipping the file anymore? Users tend to complain if
a file is in that state.

Christoph

[*] The full truth is there was a typo in
debian/postgresql-common.maintscript which made it remove apt's
/etc/apt/apt.conf.d/01autoremove instead. Oops.

#994903#8
Date:
2021-09-23 05:23:45 UTC
From:
To:
Not only that, it also breaks if the conffile has been moved to another
package.  Today's systemd upgrade surprised me by deleting two conffiles
of systemd-timesyncd:

,----
| systemd (247.9-2) wird eingerichtet ...
| Entfernen des veralteten Conffiles /etc/dhcp/dhclient-exit-hooks.d/timesyncd ...
| Entfernen des veralteten Conffiles /etc/systemd/timesyncd.conf ...
`----

,----
| $ dpkg --verify systemd-timesyncd
| ??5?????? c /etc/dhcp/dhclient-exit-hooks.d/timesyncd
| ??5?????? c /etc/systemd/timesyncd.conf
`----

Cheers,
       Sven