From 4d2abd8f9304300a0fd85efa281b9299390e681f7e9d4fa77b82fdabae62e86a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 1 Sep 2022 16:02:29 +0000 Subject: [PATCH] Accepting request 1000703 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/1000703 OBS-URL: https://build.opensuse.org/package/show/network:ldap/sssd?expand=0&rev=273 --- sssd.changes | 6 ++++++ sssd.spec | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/sssd.changes b/sssd.changes index f8d910e..fa8d717 100644 --- a/sssd.changes +++ b/sssd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 13:45:36 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Fri Aug 26 20:54:33 UTC 2022 - Jan Engelhardt diff --git a/sssd.spec b/sssd.spec index dd14a33..eedbc3e 100644 --- a/sssd.spec +++ b/sssd.spec @@ -487,6 +487,20 @@ fi %pre kcm %service_add_pre sssd-kcm.service sssd-kcm.socket +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/sssd ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif + +%if 0%{?suse_version} > 1500 +%posttrans +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/sssd ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %post kcm %service_add_post sssd-kcm.service sssd-kcm.socket