diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-20 14:06:55 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-20 14:15:26 -0400 |
| commit | b8b746a7f1bdbf179136959a85138fde60c43588 (patch) | |
| tree | 48e9b5c95a7f0ec1ef0f899513e65de96124c31a /src/Propellor/Property.hs | |
| parent | cc8bbcf95b9b0cdcd2db17ee6049263498caa79b (diff) | |
starting work on a Chroot module
factored out info up-propigation code rom Docker
Diffstat (limited to 'src/Propellor/Property.hs')
| -rw-r--r-- | src/Propellor/Property.hs | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index bf69ff60..1d750a78 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -3,6 +3,7 @@ module Propellor.Property where import System.Directory +import System.FilePath import Control.Monad import Data.Monoid import Control.Monad.IfElse @@ -12,7 +13,6 @@ import Propellor.Types import Propellor.Info import Propellor.Engine import Utility.Monad -import System.FilePath -- Constructs a Property. property :: Desc -> Propellor Result -> Property @@ -135,38 +135,6 @@ revert (RevertableProperty p1 p2) = RevertableProperty p2 p1 unrevertable :: RevertableProperty -> Property unrevertable (RevertableProperty p1 _p2) = p1 --- | Starts accumulating the properties of a Host. --- --- > host "example.com" --- > & someproperty --- > ! oldproperty --- > & otherproperty -host :: HostName -> Host -host hn = Host hn [] mempty - -class Hostlike h where - -- | Adds a property to a Host - -- - -- Can add Properties and RevertableProperties - (&) :: IsProp p => h -> p -> h - -- | Like (&), but adds the property as the - -- first property of the host. Normally, property - -- order should not matter, but this is useful - -- when it does. - (&^) :: IsProp p => h -> p -> h - -instance Hostlike Host where - (Host hn ps is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p) - (Host hn ps is) &^ p = Host hn ([toProp p] ++ ps) (getInfo p <> is) - --- | Adds a property to the Host in reverted form. -(!) :: Hostlike h => h -> RevertableProperty -> h -h ! p = h & revert p - -infixl 1 &^ -infixl 1 & -infixl 1 ! - -- Changes the action that is performed to satisfy a property. adjustProperty :: Property -> (Propellor Result -> Propellor Result) -> Property adjustProperty p f = p { propertySatisfy = f (propertySatisfy p) } |
