From cbaa2e53332fdd1afb8c272234183114a6d735e093ebc02572a6bedd6fa3933d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 13 Nov 2017 09:26:57 +0000 Subject: [PATCH] Accepting request 540661 from home:1Antoine1:branches:filesystems - 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. OBS-URL: https://build.opensuse.org/request/show/540661 OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsmaintenance?expand=0&rev=22 --- btrfsmaintenance.changes | 10 ++++++++++ btrfsmaintenance.spec | 11 +++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) 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