From 580f0fece06126aa68c59586590a9f2531ba7cce Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Tue, 24 Mar 2020 13:50:01 +0100 Subject: [PATCH] Another attempt at enabling fstrim.timer on F32 upgrades (#1811506) Avoid using %systemd_post as it is guarding the trigger with '$1 -eq 1' which not true for %triggerpostun (it's 2 for updates in triggerpostun). Also, while at this, fine-tune the trigger condition to trigger for package updates from older F32 versions as well -- this makes it much easier to test this fix, and also fixes fstrim.timer for anyone who installed from F32 beta media. --- util-linux.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index 91e90a9..a76c5a3 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.35.1 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: http://en.wikipedia.org/wiki/Util-linux @@ -485,8 +485,11 @@ fi %postun -n uuidd %systemd_postun_with_restart uuidd.service -%triggerpostun -- util-linux < 2.35 -%systemd_post fstrim.timer +%triggerpostun -- util-linux < 2.35.1-7 +if [ $1 -gt 1 ] && [ -x /usr/bin/systemctl ] ; then + # Enable fstrim.timer for upgrades to F32 + /usr/bin/systemctl --no-reload preset fstrim.timer || : +fi %files -f %{name}.files %doc README NEWS AUTHORS @@ -936,6 +939,9 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Tue Mar 24 2020 Kalev Lember - 2.35.1-7 +- Another attempt at enabling fstrim.timer on F32 upgrades (#1811506) + * Thu Mar 19 2020 Karel Zak - 2.35.1-6 - fix #1811506 (triggerpostun)