From 94f91a44810dc3a1eca95c843e3c444cbbe87006 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Dec 2015 13:30:50 -0400 Subject: add isNewerThan and use it to avoid unnecessary running of newaliases --- src/Propellor/Property/Postfix.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property') diff --git a/src/Propellor/Property/Postfix.hs b/src/Propellor/Property/Postfix.hs index bcb9fb30..e9fdfc38 100644 --- a/src/Propellor/Property/Postfix.hs +++ b/src/Propellor/Property/Postfix.hs @@ -60,8 +60,9 @@ mappedFile f setup = setup f -- | Run newaliases command, which should be done after changing -- @/etc/aliases@. newaliases :: Property NoInfo -newaliases = cmdProperty "newaliases" [] - `assume` MadeChange +newaliases = check ("/etc/aliases" `isNewerThan` "/etc/aliases.db") $ + cmdProperty "newaliases" [] + `assume` MadeChange -- | The main config file for postfix. mainCfFile :: FilePath -- cgit v1.2.3