From 222e2fe8a4cc555840ce7e2f5f9015a21f325d37 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Apr 2014 11:02:29 -0400 Subject: propellor spin --- Propellor/Property.hs | 4 +++- Propellor/Property/Scheduled.hs | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'Propellor') diff --git a/Propellor/Property.hs b/Propellor/Property.hs index c2a8972e..ca492e33 100644 --- a/Propellor/Property.hs +++ b/Propellor/Property.hs @@ -3,6 +3,7 @@ module Propellor.Property where import System.Directory import Control.Monad import Data.Monoid +import Control.Monad.IfElse import Propellor.Types import Propellor.Engine @@ -54,7 +55,8 @@ flagFile property flagfile = Property (propertyDesc property) $ go False = do r <- ensureProperty property when (r == MadeChange) $ - writeFile flagfile "" + unlessM (doesFileExist flagfile) $ + writeFile flagfile "" return r --- | Whenever a change has to be made for a Property, causes a hook diff --git a/Propellor/Property/Scheduled.hs b/Propellor/Property/Scheduled.hs index bef2a297..827c648c 100644 --- a/Propellor/Property/Scheduled.hs +++ b/Propellor/Property/Scheduled.hs @@ -21,7 +21,6 @@ import qualified Data.Map as M period :: Property -> Recurrance -> Property period prop recurrance = Property desc $ do lasttime <- getLastChecked (propertyDesc prop) - print lasttime nexttime <- fmap startTime <$> nextTime schedule lasttime t <- localNow if Just t >= nexttime -- cgit v1.3-2-g0d8e