On Mon, Aug 26, Olaf Hering wrote:
The logic below is supposed to address all 7 cases above, it just a proof-of-concept at this point. The usage of basename is wrong, it is not ready for build-compare.
Here is a short excerpt from the long list of "empty" config files which will benefit from such helper macros: /etc/default/grub /etc/exports /etc/grub.d/* /etc/libguestfs-tools.conf /etc/systemd/*.conf /etc/xen/*.conf
I do it in this simple way for pam, which works independent of if the configuration file is changed or not, at least for %config(noreplace). At first move old *.rpmsave files away in the %pre section and then rename *.rpmsave to *. I don't like to do this in the %posttrans section, as this means, the application could be broken during update of the package until end of update process, but I have no better idea: %pre for i in securetty pam.d/other pam.d/common-account pam.d/common-auth pam.d/common-password pam.d/common-session ; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i}.rpmsave.old ||: done %posttrans # Migration to /usr/etc. for i in securetty pam.d/other pam.d/common-account pam.d/common-auth pam.d/common-password pam.d/common-session ; do test -f /etc/${i}.rpmsave && mv -v /etc/${i}.rpmsave /etc/${i} done Thorsten -- Thorsten Kukuk, Distinguished Engineer, Senior Architect SLES & MicroOS SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nuernberg, Germany Managing Director: Felix Imendoerffer (HRB 247165, AG München) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org