From ce00deb62dc2960f25a84b97419dcfec4d435ede81a364e68034f822f3d4e874 Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Thu, 6 Oct 2022 09:53:23 +0000 Subject: [PATCH] Accepting request 1003795 from home:schubi2:logrotate - 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/1003795 OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=207 --- redis.changes | 6 ++++++ redis.spec | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/redis.changes b/redis.changes index 39b4c50..10e09f8 100644 --- a/redis.changes +++ b/redis.changes @@ -29,6 +29,12 @@ Wed Sep 21 20:36:11 UTC 2022 - Michael Ströder * Fix ACL: BITFIELD with GET and also SET / INCRBY can be executed with read-only key permission (#11086) * Fix missing sections for INFO ALL when also requesting a module info section (#11291) +------------------------------------------------------------------- +Thu Sep 1 07:15:24 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Mon Jul 18 14:36:34 UTC 2022 - Michael Ströder diff --git a/redis.spec b/redis.spec index 6a41609..7e42a9a 100644 --- a/redis.spec +++ b/redis.spec @@ -131,6 +131,20 @@ EOF %pre -f %{name}.pre %service_add_pre %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/%{name} ; 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/%{name} ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %post %tmpfiles_create %{_tmpfilesdir}/%{name}.conf