On Fr, 2021-05-28 at 16:41 +0000, Martin Wilck wrote:
I've considered to detect these ".conf.rpmsave" files in a %posttrans script and rename them back to ".conf". That would work AFAICS, but I'm not sure if I can exclude weird side effects; in particular, I must take care not to restore previously created .rpmsave files, and I should only do this once, when upgrading from a previous version that still owned the files under /etc (I don't know how to detect that). In general, this approach feels pretty much like a hack.
I think I've worked it out. I can check in %post whether the previously installed version of my package owned files under /etc/modprobe.d, and if yes, restore the modified .conf files from .conf.rpmsave in %posttrans. Regards, Martin