[config-package-dev] unhiding in prerm doesn't work if/because file with the same name still exists

Kernc kerncece at gmail.com
Thu Jun 19 11:33:22 EDT 2014


Hi,

Firstly, kudos on this neat and handy piece of middleware!

I want to divert /etc/skel/.bashrc. I'm trying to _hide_ it instead of
displacing to avoid creation of superfluous and confusing files with a
symlink in user's home.
If I replace the hidden .bashrc it with my own /etc/skel/.bashrc
conffile, I get the """Package distributor has shipped an updated
version. What would you like to do about it ?""" query as popularly
described.¹ ²

[1]: https://bugs.debian.org/363524
[2]: https://wiki.debian.org/ConfigPackages#conffiles

OTOH, if I do the recommended and install the file as non-conffile and
only link it in /etc, then the package's prerm script fails to remove
the diversion on uninstall because of the condition in the
undisplace_unlink_displace() function.³ The file still exists.

[3]: https://athena10.mit.edu/trac/browser/config-package-dev/displace.sh.in?rev=8d36c7611f0b3f3a16447b613d0e2a6ad0b1059f#L108

Could the condition be loosened a little? Currently, the first
condition, [ ! -L ... ], is excessive anyway since [ ! -e ... ] covers
it. Some refactoring seems to be in order. Why not undivert in any
case?

I managed to get the package install/upgrade/purge as I expect it by
manually dpkg-diverting to /usr/share in preinst, with link pointing
to my version in /usr/share, and removing the diversion in *postrm*.
Why is the hide diversion in c-p-d lifted in prerm?

If sensible, please extend the functionality of  _hide_ to this use
case. Additionally, "dpkg -i bash.deb my-bash-config.deb" installs
correctly without error (with my-bash-config with manual diversions,
as above). This slightly contradicts⁴

> Do not give the replacement cron job the same name as the original one ...
> If you do, it will not be possible to install your package in the same apt invocation ....

[4]: https://debathena.mit.edu/config-packages/#The_hide_operation

Please illuminate me.
Thanks again.



More information about the config-package-dev mailing list