Accepting request 1003832 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/1003832
OBS-URL: https://build.opensuse.org/package/show/server:proxy/squid?expand=0&rev=263
This commit is contained in:
Adam Majer 2022-09-26 10:29:20 +00:00 committed by Git OBS Bridge
parent 7c543ee7fd
commit 0c32424ab7
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Sep 15 10:41:14 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.
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Sep 11 08:00:04 UTC 2022 - Dirk Müller <dmueller@suse.com> Sun Sep 11 08:00:04 UTC 2022 - Dirk Müller <dmueller@suse.com>

View File

@ -270,6 +270,20 @@ if [ $(%{_bindir}/id -nG %{name} 2>/dev/null | grep -q winbind; echo $?) -ne 0 ]
fi fi
%endif %endif
%service_add_pre %{name}.service %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/%{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
# update mode? # update mode?
if [ "$1" -gt "1" ]; then if [ "$1" -gt "1" ]; then