summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Ccache.hs
diff options
context:
space:
mode:
authorSean Whitton2016-05-22 10:33:16 +0900
committerSean Whitton2016-05-22 10:33:16 +0900
commitb6f3970c83e943770e2d6afdb12591dae5a567fd (patch)
treeb1b15124353eda6691e8e2052f722a824be39e95 /src/Propellor/Property/Ccache.hs
parent185a53d48b58c089eb9de3a8a1b47347841a65e8 (diff)
don't invoke ccache with no params
Diffstat (limited to 'src/Propellor/Property/Ccache.hs')
-rw-r--r--src/Propellor/Property/Ccache.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs
index 89fcd54c..a8cc36f1 100644
--- a/src/Propellor/Property/Ccache.hs
+++ b/src/Propellor/Property/Ccache.hs
@@ -14,7 +14,6 @@ import qualified Propellor.Property.Apt as Apt
import Utility.FileMode
import Utility.DataUnits
import System.Posix.Files
-import Data.Either
-- | Limits on the size of a ccache
data Limit
@@ -58,16 +57,17 @@ ccacheSizeUnits sz = filter (/= ' ') (roughSize cfgfileunits True sz)
hasLimits :: FilePath -> Limit -> Property DebianLike
path `hasLimits` limit = go `requires` installed
where
- go :: Property DebianLike
- go = property' ("limits set on ccache " ++ path) $
- \w -> if null errors
+ go
+ | null params' = doNothing
-- We invoke ccache itself to set the limits, so that it can
-- handle replacing old limits in the config file, duplicates
-- etc.
- then ensureProperty w $
+ | null errors =
cmdPropertyEnv "ccache" params' [("CCACHE_DIR", path)]
`changesFile` (path </> "ccache.conf")
- else sequence_ (errorMessage <$> errors)
+ `describe` "h"
+ | otherwise = property "couldn't parse ccache limits" $
+ sequence_ (errorMessage <$> errors)
>> return FailedChange
params = limitToParams limit