Accepting request 1003790 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/1003790
OBS-URL: https://build.opensuse.org/package/show/network:utilities/net-snmp?expand=0&rev=50
This commit is contained in:
Alexander Bergmann 2022-09-21 13:56:32 +00:00 committed by Git OBS Bridge
parent f005ed495d
commit 074cb150e1
2 changed files with 20 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Sep 1 07:27:27 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 Jul 12 14:18:13 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -320,6 +320,20 @@ find %{buildroot} -type f -name "*.la" -delete -print
%pre
%service_add_pre snmpd.service snmptrapd.service
%if 0%{?suse_version} > 1500
# Prepare for migration to /usr/etc; save any old .rpmsave
for i in logrotate.d/net-snmp ; 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/net-snmp ; do
test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||:
done
%endif
%post
%fillup_only -n snmpd