From 598e703eb04764fae0d647d9e2fbcfe646f4131c37943205528689d93fba8cf9 Mon Sep 17 00:00:00 2001 From: David Anes Date: Mon, 12 Sep 2022 14:17:53 +0000 Subject: [PATCH] Accepting request 1000493 from home:schubi2 - Migration to /usr/etc: Saving user changed configuration files in /etc and restoring them while an RPM update. OBS-URL: https://build.opensuse.org/request/show/1000493 OBS-URL: https://build.opensuse.org/package/show/server:mail/fetchmail?expand=0&rev=139 --- fetchmail.changes | 6 ++++++ fetchmail.spec | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/fetchmail.changes b/fetchmail.changes index 2c04ce6..8843098 100644 --- a/fetchmail.changes +++ b/fetchmail.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 31 15:47:06 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Sat Jul 30 19:10:08 UTC 2022 - Matej Cepl diff --git a/fetchmail.spec b/fetchmail.spec index 67a1ac2..635087f 100644 --- a/fetchmail.spec +++ b/fetchmail.spec @@ -152,12 +152,26 @@ rm -r contrib/gai* %pre -f fetchmail.pre %service_add_pre %{name}.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/fetchmail ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif %post %fillup_only %tmpfiles_create %{name}.conf %service_add_post %{name}.service +%if 0%{?suse_version} > 1500 +%posttrans +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/fetchmail ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif + %preun %service_del_preun %{name}.service