diff --git a/net-snmp.changes b/net-snmp.changes index b7c4ec6..75de764 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 07:27:27 UTC 2022 - Stefan Schubert + +- 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 diff --git a/net-snmp.spec b/net-snmp.spec index ceeffd7..ff475a4 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -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