diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-22 09:59:10 +0900 |
|---|---|---|
| committer | Sean Whitton <spwhitton@spwhitton.name> | 2016-05-22 09:59:10 +0900 |
| commit | 47fbeac70e53e97d0ea42fafad8078c0d9d4d9f7 (patch) | |
| tree | 9e4d856c0310275e98dc7f809c7d403a83e4dc62 /src | |
| parent | 4d6e5dcab821bc618dedc515b817db3a79e5bc84 (diff) | |
hasLimits requires installed
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Ccache.hs | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index 1b0f8332..89fcd54c 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -55,17 +55,21 @@ ccacheSizeUnits sz = filter (/= ' ') (roughSize cfgfileunits True sz) p n = 1024^n -- | Set limits on a given ccache -hasLimits :: FilePath -> Limit -> Property UnixLike -path `hasLimits` limit = property' ("limits set on ccache " ++ path) $ - \w -> if null errors - -- 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 $ - cmdPropertyEnv "ccache" params' [("CCACHE_DIR", path)] - `changesFile` (path </> "ccache.conf") - else sequence_ (errorMessage <$> errors) - >> return FailedChange +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 + -- 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 $ + cmdPropertyEnv "ccache" params' [("CCACHE_DIR", path)] + `changesFile` (path </> "ccache.conf") + else sequence_ (errorMessage <$> errors) + >> return FailedChange + params = limitToParams limit (errors, params') = partitionEithers params |
