From 530d9f1b2bb1d740a4ca7404f0e885c64626a0e0 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 19 May 2016 15:00:08 +0900 Subject: add Ccache.hs --- src/Propellor/Property/Ccache.hs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Propellor/Property/Ccache.hs (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs new file mode 100644 index 00000000..6ee796f0 --- /dev/null +++ b/src/Propellor/Property/Ccache.hs @@ -0,0 +1,39 @@ +-- | Maintainer: Sean Whitton + +module Propellor.Property.Ccache where + +import Propellor.Base +import qualified Propellor.Property.File as File +import qualified Propellor.Property.Apt as Apt + +import Utility.FileMode +import System.Posix.Files + +-- | Configures a ccache in /var/cache for a group +-- +-- If you say +-- +-- > & (Group "foo") `Ccache.hasGroupCache` "4G" +-- +-- you instruct propellor to create a ccache in /var/cache/ccache-foo owned and +-- writeable by the foo group, with a maximum cache size of 4GB. See ccache(1) +-- for size specification. +hasGroupCache :: Group -> String -> RevertableProperty DebianLike UnixLike +group@(Group g) `hasGroupCache` size = (make `requires` installed) delete + where + path = "/var/cache/ccache-" ++ g + make = check (not <$> doesDirectoryExist path) $ + propertyList ("ccache for " ++ g ++ " exists") $ props + & File.dirExists path + & File.ownerGroup path (User "root") group + & File.mode path (combineModes $ + readModes ++ executeModes + ++ [ownerWriteMode, groupWriteMode]) + & cmdProperty "ccache" ["--max-size", size] + `assume` MadeChange + delete = check (doesDirectoryExist path) $ + cmdProperty "rm" ["-r", path] `assume` MadeChange + `describe` ("ccache for " ++ g ++ " does not exist") + +installed :: Property DebianLike +installed = Apt.installed ["ccache"] -- cgit v1.3-2-g0d8e From 10f3c2db21a4b5c53d2575977cc1228fb71c9bc8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 21 May 2016 20:04:25 +0900 Subject: generalise setting limit on ccache --- src/Propellor/Property/Ccache.hs | 43 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index 6ee796f0..d9b2e458 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -9,31 +9,52 @@ import qualified Propellor.Property.Apt as Apt import Utility.FileMode import System.Posix.Files +-- | Limits on the size of a ccache +data CcacheLimit + -- | The maximum size of the cache, as a string such as "4G" + -- + -- See ccache(1) for more on the size specification. + = MaxSize String + -- | The maximum number of files in the cache + | MaxFiles Int + -- | A cache with no limit specified + | NoLimit + -- | Configures a ccache in /var/cache for a group -- -- If you say -- --- > & (Group "foo") `Ccache.hasGroupCache` "4G" +-- > & (Group "foo") `Ccache.hasGroupCache` (Ccache.MaxSize "4g") -- -- you instruct propellor to create a ccache in /var/cache/ccache-foo owned and --- writeable by the foo group, with a maximum cache size of 4GB. See ccache(1) --- for size specification. -hasGroupCache :: Group -> String -> RevertableProperty DebianLike UnixLike -group@(Group g) `hasGroupCache` size = (make `requires` installed) delete +-- writeable by the foo group, with a maximum cache size of 4GB. +-- +-- It is safe to specify this property more than once for a given group if you +-- wish to limit both the maximum size of the cache and the maximum number of +-- files in the cache. However, setting only one of these two limits is +-- generally sufficient. +hasGroupCache :: Group -> CcacheLimit -> RevertableProperty DebianLike UnixLike +group@(Group g) `hasGroupCache` limit = (make `requires` installed) delete where - path = "/var/cache/ccache-" ++ g - make = check (not <$> doesDirectoryExist path) $ - propertyList ("ccache for " ++ g ++ " exists") $ props + make = propertyList ("ccache for " ++ g ++ " exists") $ props & File.dirExists path & File.ownerGroup path (User "root") group & File.mode path (combineModes $ readModes ++ executeModes - ++ [ownerWriteMode, groupWriteMode]) - & cmdProperty "ccache" ["--max-size", size] - `assume` MadeChange + ++ [ownerWriteMode, groupWriteMode]) + & case limit of + NoLimit -> doNothing + MaxSize s -> setSizeLimit s + MaxFiles f -> setFileLimit (show f) + delete = check (doesDirectoryExist path) $ cmdProperty "rm" ["-r", path] `assume` MadeChange `describe` ("ccache for " ++ g ++ " does not exist") + setSizeLimit s = conf `File.containsLine` ("max_size = " ++ s) + setFileLimit f = conf `File.containsLine` ("max_files = " ++ f) + path = "/var/cache/ccache-" ++ g + conf = path "ccache.conf" + installed :: Property DebianLike installed = Apt.installed ["ccache"] -- cgit v1.3-2-g0d8e From 4a53b158a2b6ca5e64f45058b2e26fe0a0c579e9 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 21 May 2016 20:09:31 +0900 Subject: update Sbuild.hs for new Ccache.hs --- src/Propellor/Property/Ccache.hs | 4 ++-- src/Propellor/Property/Sbuild.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index d9b2e458..45208508 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -10,7 +10,7 @@ import Utility.FileMode import System.Posix.Files -- | Limits on the size of a ccache -data CcacheLimit +data Limit -- | The maximum size of the cache, as a string such as "4G" -- -- See ccache(1) for more on the size specification. @@ -33,7 +33,7 @@ data CcacheLimit -- wish to limit both the maximum size of the cache and the maximum number of -- files in the cache. However, setting only one of these two limits is -- generally sufficient. -hasGroupCache :: Group -> CcacheLimit -> RevertableProperty DebianLike UnixLike +hasGroupCache :: Group -> Limit -> RevertableProperty DebianLike UnixLike group@(Group g) `hasGroupCache` limit = (make `requires` installed) delete where make = propertyList ("ccache for " ++ g ++ " exists") $ props diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 996b5619..ecf33712 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -240,7 +240,7 @@ keypairGenerated = check (not <$> doesFileExist secKeyFile) $ go -- another script from wiki.d.o/sbuild ccachePrepared :: Property DebianLike ccachePrepared = propertyList "sbuild group ccache configured" $ props - & Group "sbuild" `Ccache.hasGroupCache` "2G" + & Group "sbuild" `Ccache.hasGroupCache` (Ccache.MaxSize "2G") & "/etc/schroot/sbuild/fstab" `File.containsLine` "/var/cache/ccache-sbuild /var/cache/ccache-sbuild none rw,bind 0 0" & "/var/cache/ccache-sbuild/sbuild-setup" `File.hasContent` -- cgit v1.3-2-g0d8e From 36d005c1bb298d4cf8cf274680d41b90c2425f87 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 21 May 2016 22:07:18 +0900 Subject: descs --- src/Propellor/Property/Ccache.hs | 2 +- src/Propellor/Property/Sbuild.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index 45208508..f511def7 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -36,7 +36,7 @@ data Limit hasGroupCache :: Group -> Limit -> RevertableProperty DebianLike UnixLike group@(Group g) `hasGroupCache` limit = (make `requires` installed) delete where - make = propertyList ("ccache for " ++ g ++ " exists") $ props + make = propertyList ("ccache for " ++ g ++ " group exists") $ props & File.dirExists path & File.ownerGroup path (User "root") group & File.mode path (combineModes $ diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 87c93315..21a1fc8d 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -318,6 +318,7 @@ ccachePrepared = propertyList "sbuild group ccache configured" $ props & Group "sbuild" `Ccache.hasGroupCache` (Ccache.MaxSize "2G") & "/etc/schroot/sbuild/fstab" `File.containsLine` "/var/cache/ccache-sbuild /var/cache/ccache-sbuild none rw,bind 0 0" + `describe` "ccache mounted in sbuild schroots" & "/var/cache/ccache-sbuild/sbuild-setup" `File.hasContent` [ "#!/bin/sh" , "" -- cgit v1.3-2-g0d8e From 0a5bd1b3ff4f211db9d29ce2a1b9271e836268f6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 08:35:58 +0900 Subject: hasGroupCache -> hasCache I was originally thinking that the name `Ccache.hasCache` might be for a property `User -> Property DebianLike`. However, someone wanted to write a property configuring a user cache, it would probably have the standard location `~/.ccache`. This cache would be implicitly created when required, so the name `Ccache.hasCache` would be needed. --- src/Propellor/Property/Ccache.hs | 4 ++-- src/Propellor/Property/Sbuild.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index f511def7..b721e684 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -33,8 +33,8 @@ data Limit -- wish to limit both the maximum size of the cache and the maximum number of -- files in the cache. However, setting only one of these two limits is -- generally sufficient. -hasGroupCache :: Group -> Limit -> RevertableProperty DebianLike UnixLike -group@(Group g) `hasGroupCache` limit = (make `requires` installed) delete +hasCache :: Group -> Limit -> RevertableProperty DebianLike UnixLike +group@(Group g) `hasCache` limit = (make `requires` installed) delete where make = propertyList ("ccache for " ++ g ++ " group exists") $ props & File.dirExists path diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index fe22c038..df9c5a37 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -313,7 +313,7 @@ keypairGenerated = check (not <$> doesFileExist secKeyFile) $ go -- another script from wiki.d.o/sbuild ccachePrepared :: Property DebianLike ccachePrepared = propertyList "sbuild group ccache configured" $ props - & Group "sbuild" `Ccache.hasGroupCache` (Ccache.MaxSize "2G") + & Group "sbuild" `Ccache.hasCache` (Ccache.MaxSize "2G") & "/etc/schroot/sbuild/fstab" `File.containsLine` "/var/cache/ccache-sbuild /var/cache/ccache-sbuild none rw,bind 0 0" `describe` "ccache mounted in sbuild schroots" -- cgit v1.3-2-g0d8e From 8ed862f8239d5a5ec4cfa1e5dea24add38038ab1 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 09:11:07 +0900 Subject: start reworking Ccache.Limit to Utility.DataSize --- src/Propellor/Property/Ccache.hs | 71 +++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 19 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index b721e684..692fea0f 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -1,38 +1,77 @@ -- | Maintainer: Sean Whitton -module Propellor.Property.Ccache where +module Propellor.Property.Ccache ( + hasCache, + hasLimits, + Limit(..), + DataSize, +) where import Propellor.Base import qualified Propellor.Property.File as File import qualified Propellor.Property.Apt as Apt import Utility.FileMode +import Utility.DataUnits import System.Posix.Files -- | Limits on the size of a ccache data Limit -- | The maximum size of the cache, as a string such as "4G" - -- - -- See ccache(1) for more on the size specification. - = MaxSize String + = MaxSize DataSize -- | The maximum number of files in the cache - | MaxFiles Int + | MaxFiles Integer -- | A cache with no limit specified | NoLimit + | Limit :+ Limit + +instance Monoid Limit where + mempty = NoLimit + mappend = (:+) + +-- | A string that will be parsed to get a data size. +-- +-- Examples: "100 megabytes" or "0.5tb" +type DataSize = String + +maxSizeParam :: DataSize -> Maybe String +maxSizeParam s = readSize dataUnits s + >>= \sz -> Just $ "--max-size=" ++ ccacheSizeUnits sz + +-- Generates size units as used in ccache.conf. The smallest unit we can +-- specify in a ccache config files is a kilobyte +ccacheSizeUnits :: Integer -> String +ccacheSizeUnits sz = filter (/= ' ') (roughSize cfgfileunits True sz) + where + cfgfileunits :: [Unit] + cfgfileunits = + [ Unit (p 4) "Ti" "terabyte" + , Unit (p 3) "Gi" "gigabyte" + , Unit (p 2) "Mi" "megabyte" + , Unit (p 1) "Ki" "kilobyte" + ] + p :: Integer -> Integer + p n = 1024^n + +-- | Set limits on a given ccache. +hasLimits :: FilePath -> Limit -> Property UnixLike +hasLimits = undefined + +-- limitToParams :: Limit -> [String] +-- limitToParams NoLimit = [] +-- limitToParams (MaxSize s) = +-- limitToParams (MaxFiles f) = +-- limitToParams (l1 :+ l2) = limitToParams l1 <> limitToParams l2 -- | Configures a ccache in /var/cache for a group -- -- If you say -- --- > & (Group "foo") `Ccache.hasGroupCache` (Ccache.MaxSize "4g") +-- > & (Group "foo") `Ccache.hasGroupCache` (Ccache.MaxSize "4G" +-- <> Ccache.MaxFiles 10000) -- -- you instruct propellor to create a ccache in /var/cache/ccache-foo owned and --- writeable by the foo group, with a maximum cache size of 4GB. --- --- It is safe to specify this property more than once for a given group if you --- wish to limit both the maximum size of the cache and the maximum number of --- files in the cache. However, setting only one of these two limits is --- generally sufficient. +-- writeable by the foo group, with a maximum cache size of 4GB or 10000 files. hasCache :: Group -> Limit -> RevertableProperty DebianLike UnixLike group@(Group g) `hasCache` limit = (make `requires` installed) delete where @@ -42,19 +81,13 @@ group@(Group g) `hasCache` limit = (make `requires` installed) delete & File.mode path (combineModes $ readModes ++ executeModes ++ [ownerWriteMode, groupWriteMode]) - & case limit of - NoLimit -> doNothing - MaxSize s -> setSizeLimit s - MaxFiles f -> setFileLimit (show f) + & hasLimits path limit delete = check (doesDirectoryExist path) $ cmdProperty "rm" ["-r", path] `assume` MadeChange `describe` ("ccache for " ++ g ++ " does not exist") - setSizeLimit s = conf `File.containsLine` ("max_size = " ++ s) - setFileLimit f = conf `File.containsLine` ("max_files = " ++ f) path = "/var/cache/ccache-" ++ g - conf = path "ccache.conf" installed :: Property DebianLike installed = Apt.installed ["ccache"] -- cgit v1.3-2-g0d8e From 52505a7d9f85e82fc2c50565f6646b441e0faf53 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 09:32:05 +0900 Subject: property to set the limits filled out --- src/Propellor/Property/Ccache.hs | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index 692fea0f..8b6ddb5a 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -14,6 +14,7 @@ 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 @@ -55,20 +56,33 @@ ccacheSizeUnits sz = filter (/= ' ') (roughSize cfgfileunits True sz) -- | Set limits on a given ccache. hasLimits :: FilePath -> Limit -> Property UnixLike -hasLimits = undefined +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 + where + params = limitToParams limit + (errors, params') = partitionEithers params --- limitToParams :: Limit -> [String] --- limitToParams NoLimit = [] --- limitToParams (MaxSize s) = --- limitToParams (MaxFiles f) = --- limitToParams (l1 :+ l2) = limitToParams l1 <> limitToParams l2 +limitToParams :: Limit -> [Either String String] +limitToParams NoLimit = [] +limitToParams (MaxSize s) = case maxSizeParam s of + Just param -> [Right param] + Nothing -> [Left $ "unable to parse data size " ++ s] +limitToParams (MaxFiles f) = [Right $ "--max-files=" ++ show f] +limitToParams (l1 :+ l2) = limitToParams l1 <> limitToParams l2 -- | Configures a ccache in /var/cache for a group -- -- If you say -- -- > & (Group "foo") `Ccache.hasGroupCache` (Ccache.MaxSize "4G" --- <> Ccache.MaxFiles 10000) +-- > <> Ccache.MaxFiles 10000) -- -- you instruct propellor to create a ccache in /var/cache/ccache-foo owned and -- writeable by the foo group, with a maximum cache size of 4GB or 10000 files. -- cgit v1.3-2-g0d8e From 4d6e5dcab821bc618dedc515b817db3a79e5bc84 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 09:51:53 +0900 Subject: consistency --- src/Propellor/Property/Ccache.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index 8b6ddb5a..1b0f8332 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -54,7 +54,7 @@ ccacheSizeUnits sz = filter (/= ' ') (roughSize cfgfileunits True sz) p :: Integer -> Integer p n = 1024^n --- | Set limits on a given ccache. +-- | Set limits on a given ccache hasLimits :: FilePath -> Limit -> Property UnixLike path `hasLimits` limit = property' ("limits set on ccache " ++ path) $ \w -> if null errors -- cgit v1.3-2-g0d8e From 47fbeac70e53e97d0ea42fafad8078c0d9d4d9f7 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 09:59:10 +0900 Subject: hasLimits requires installed --- src/Propellor/Property/Ccache.hs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') 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 -- cgit v1.3-2-g0d8e 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.3-2-g0d8e From 71c40ba6d6bc7a74813f7fdef5964e85fe251ea1 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 10:35:18 +0900 Subject: rm dummy desc --- src/Propellor/Property/Ccache.hs | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index a8cc36f1..b8fa0d85 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -65,7 +65,6 @@ path `hasLimits` limit = go `requires` installed | null errors = cmdPropertyEnv "ccache" params' [("CCACHE_DIR", path)] `changesFile` (path "ccache.conf") - `describe` "h" | otherwise = property "couldn't parse ccache limits" $ sequence_ (errorMessage <$> errors) >> return FailedChange -- cgit v1.3-2-g0d8e From 0b17dee7b9ea38e7d0342189cd16b19731fa2f61 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 22 May 2016 10:42:21 +0900 Subject: changesFile -> changesFileContent --- src/Propellor/Property/Ccache.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index b8fa0d85..ce5e836c 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -64,7 +64,7 @@ path `hasLimits` limit = go `requires` installed -- etc. | null errors = cmdPropertyEnv "ccache" params' [("CCACHE_DIR", path)] - `changesFile` (path "ccache.conf") + `changesFileContent` (path "ccache.conf") | otherwise = property "couldn't parse ccache limits" $ sequence_ (errorMessage <$> errors) >> return FailedChange -- cgit v1.3-2-g0d8e From 73200c35591c641ac00b4afae0d2276339ce7c21 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 May 2016 11:22:34 -0400 Subject: more consistent layout in example --- src/Propellor/Property/Ccache.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property/Ccache.hs') diff --git a/src/Propellor/Property/Ccache.hs b/src/Propellor/Property/Ccache.hs index ce5e836c..f2246fe1 100644 --- a/src/Propellor/Property/Ccache.hs +++ b/src/Propellor/Property/Ccache.hs @@ -84,8 +84,8 @@ limitToParams (l1 :+ l2) = limitToParams l1 <> limitToParams l2 -- -- If you say -- --- > & (Group "foo") `Ccache.hasGroupCache` (Ccache.MaxSize "4G" --- > <> Ccache.MaxFiles 10000) +-- > & (Group "foo") `Ccache.hasGroupCache` +-- > (Ccache.MaxSize "4G" <> Ccache.MaxFiles 10000) -- -- you instruct propellor to create a ccache in /var/cache/ccache-foo owned and -- writeable by the foo group, with a maximum cache size of 4GB or 10000 files. -- cgit v1.3-2-g0d8e