From 671bd073934fe925b5538c87c65051a64888b2418ae3435347c5bc0b5253c900 Mon Sep 17 00:00:00 2001 From: David Anes Date: Mon, 12 Sep 2022 14:19:59 +0000 Subject: [PATCH] Accepting request 1000687 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/1000687 OBS-URL: https://build.opensuse.org/package/show/network/rsync?expand=0&rev=95 --- rsync.changes | 6 ++++++ rsync.spec | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/rsync.changes b/rsync.changes index 6bf7837..44ce0a9 100644 --- a/rsync.changes +++ b/rsync.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 13:11:01 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Aug 16 08:19:20 UTC 2022 - David Anes diff --git a/rsync.spec b/rsync.spec index 4a679d5..19b1af5 100644 --- a/rsync.spec +++ b/rsync.spec @@ -134,6 +134,20 @@ ln -sf service %{buildroot}%{_sbindir}/rcrsyncd %pre %service_add_pre rsyncd.service +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/rsync ; 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/rsync ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %preun %service_del_preun rsyncd.service