Accepting request 1003791 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/1003791
OBS-URL: https://build.opensuse.org/package/show/network:utilities/openslp?expand=0&rev=78
This commit is contained in:
Michael Schröder 2022-10-28 12:52:36 +00:00 committed by Git OBS Bridge
parent 025907489c
commit 68e0b968ef
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Aug 31 14:21:40 UTC 2022 - Stefan Schubert <schubi@suse.com>
- Migration to /usr/etc: Saving user changed configuration files
in /etc and restoring them while an RPM update.
-------------------------------------------------------------------
Tue Jun 21 12:38:51 UTC 2022 - Stefan Schubert <schubi@suse.com>

View File

@ -206,6 +206,20 @@ install -D -m 644 %{SOURCE9} %{buildroot}%{_unitdir}/slpd.service
%pre server
getent passwd openslp >/dev/null || useradd -r -g daemon -d %{_localstatedir}/lib/empty -s /sbin/nologin -c "openslp daemon" openslp
%service_add_pre slpd.service
%if 0%{?suse_version} > 1500
# Prepare for migration to /usr/etc; save any old .rpmsave
for i in logrotate.d/openslp-server ; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||:
done
%endif
%if 0%{?suse_version} > 1500
%posttrans server
# Migration to /usr/etc, restore just created .rpmsave
for i in logrotate.d/openslp-server ; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif
%post server
%service_add_post slpd.service