diff --git a/btrfsmaintenance.changes b/btrfsmaintenance.changes index 8a8b4fd..b45c1d5 100644 --- a/btrfsmaintenance.changes +++ b/btrfsmaintenance.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Nov 10 22:12:08 UTC 2017 - antoine.belvire@opensuse.org + +- Fix cron symlinks removal upon package upgrade (boo#904518): + * The problem was in the preun section (in the old RPM). + * This means the symlinks are removed by this update, but won't + be by the next ones. + * Please run 'systemctl start btrfsmaintenance-refresh' one more + time to fix your symlinks. + ------------------------------------------------------------------- Tue Nov 7 22:06:55 UTC 2017 - antoine.belvire@opensuse.org diff --git a/btrfsmaintenance.spec b/btrfsmaintenance.spec index a7ead79..4162c43 100644 --- a/btrfsmaintenance.spec +++ b/btrfsmaintenance.spec @@ -95,7 +95,12 @@ install -m 644 -D sysconfig.btrfsmaintenance %{buildroot}%{_localstatedir}/adm/f %preun %service_del_preun btrfsmaintenance-refresh.service -%{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh uninstall +if [ $1 -eq 0 ]; then + # Remove cron files in %%preun only if it's a package removal. + # If it's an upgrade, the %%post section of the new package has + # already refreshed the cron links, so we shall not remove them. + %{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh uninstall +fi %postun %service_del_postun btrfsmaintenance-refresh.service @@ -104,7 +109,9 @@ install -m 644 -D sysconfig.btrfsmaintenance %{buildroot}%{_localstatedir}/adm/f %if 0%{?suse_version} < 1210 %preun -%{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh uninstall +if [ $1 -eq 0 ]; then + %{_datadir}/%{name}/btrfsmaintenance-refresh-cron.sh uninstall +fi %endif %files