From b6f3970c83e943770e2d6afdb12591dae5a567fd Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 10:33:16 +0900 Subject: don't invoke ccache with no params --- src/Propellor/Property/Ccache.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') 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 -- cgit v1.2.3