diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-11-11 17:54:40 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-11-11 17:54:40 -0400 |
| commit | 4cbcfd3c386efb094b9e21dcb6e32111f9431f84 (patch) | |
| tree | db98e39ed645207990d77f8bf49138965f57881e /src | |
| parent | 2977e6abdf8eb9043fc722f8bb87ef60d42cb579 (diff) | |
| parent | dddfbc2f76d1d8be74d34b2d3d90e206d9f001a2 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Container.hs | 3 | ||||
| -rw-r--r-- | src/Propellor/EnsureProperty.hs | 5 | ||||
| -rw-r--r-- | src/Propellor/Info.hs | 6 | ||||
| -rw-r--r-- | src/Propellor/Message.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/PropAccum.hs | 9 | ||||
| -rw-r--r-- | src/Propellor/Property.hs | 2 | ||||
| -rw-r--r-- | src/Propellor/Property/Group.hs | 4 |
7 files changed, 28 insertions, 3 deletions
diff --git a/src/Propellor/Container.hs b/src/Propellor/Container.hs index c4d6f864..26194456 100644 --- a/src/Propellor/Container.hs +++ b/src/Propellor/Container.hs @@ -43,6 +43,9 @@ propagateContainer :: -- Since the children being added probably have info, -- require the Property's metatypes to have info. + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. ( IncludesInfo metatypes ~ 'True , IsContainer c ) diff --git a/src/Propellor/EnsureProperty.hs b/src/Propellor/EnsureProperty.hs index c4666722..30dfd5ad 100644 --- a/src/Propellor/EnsureProperty.hs +++ b/src/Propellor/EnsureProperty.hs @@ -37,6 +37,9 @@ import Prelude -- with the property to be lost. ensureProperty :: + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. ( Cannot_ensureProperty_WithInfo inner ~ 'True , (Targets inner `NotSuperset` Targets outer) ~ 'CanCombine ) @@ -45,7 +48,7 @@ ensureProperty -> Propellor Result ensureProperty _ = catchPropellor . getSatisfy --- The name of this was chosen to make type errors a more understandable. +-- The name of this was chosen to make type errors a bit more understandable. type family Cannot_ensureProperty_WithInfo (l :: [a]) :: Bool type instance Cannot_ensureProperty_WithInfo '[] = 'True type instance Cannot_ensureProperty_WithInfo (t ': ts) = diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs index e9218291..3d7f07a5 100644 --- a/src/Propellor/Info.hs +++ b/src/Propellor/Info.hs @@ -38,6 +38,9 @@ import Prelude -- -- The new Property will include HasInfo in its metatypes. setInfoProperty + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. :: (MetaTypes metatypes' ~ (+) HasInfo metatypes, SingI metatypes') => Property metatypes -> Info @@ -47,6 +50,9 @@ setInfoProperty (Property _ d a oldi c) newi = -- | Adds more info to a Property that already HasInfo. addInfoProperty + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. :: (IncludesInfo metatypes ~ 'True) => Property metatypes -> Info diff --git a/src/Propellor/Message.hs b/src/Propellor/Message.hs index f728e143..97573516 100644 --- a/src/Propellor/Message.hs +++ b/src/Propellor/Message.hs @@ -73,7 +73,7 @@ actionMessage = actionMessage' Nothing actionMessageOn :: (MonadIO m, MonadMask m, ActionResult r) => HostName -> Desc -> m r -> m r actionMessageOn = actionMessage' . Just -actionMessage' :: (MonadIO m, MonadMask m, ActionResult r) => Maybe HostName -> Desc -> m r -> m r +actionMessage' :: (MonadIO m, ActionResult r) => Maybe HostName -> Desc -> m r -> m r actionMessage' mhn desc a = do liftIO $ outputConcurrent =<< whenConsole (setTitleCode $ "propellor: " ++ desc) diff --git a/src/Propellor/PropAccum.hs b/src/Propellor/PropAccum.hs index fcac60bf..5d1d3afb 100644 --- a/src/Propellor/PropAccum.hs +++ b/src/Propellor/PropAccum.hs @@ -51,6 +51,9 @@ type instance GetMetaTypes (RevertableProperty (MetaTypes t) undo) = MetaTypes t (&) :: ( IsProp p + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. , MetaTypes y ~ GetMetaTypes p , CheckCombinable x y ~ 'CanCombine ) @@ -63,6 +66,9 @@ Props c & p = Props (c ++ [toChildProperty p]) (&^) :: ( IsProp p + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. , MetaTypes y ~ GetMetaTypes p , CheckCombinable x y ~ 'CanCombine ) @@ -73,6 +79,9 @@ Props c &^ p = Props (toChildProperty p : c) -- | Adds a property in reverted form. (!) + -- -Wredundant-constraints is turned off because + -- this constraint appears redundant, but is actually + -- crucial. :: (CheckCombinable x z ~ 'CanCombine) => Props (MetaTypes x) -> RevertableProperty (MetaTypes y) (MetaTypes z) diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index 7ee9397e..ae4fc914 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -345,7 +345,7 @@ revert (RevertableProperty p1 p2) = RevertableProperty p2 p1 -- | Apply a property to each element of a list. applyToList - :: (Foldable t, Functor t, IsProp p, Combines p p, p ~ CombinedType p p) + :: (Foldable t, Functor t, Combines p p, p ~ CombinedType p p) => (b -> p) -> t b -> p diff --git a/src/Propellor/Property/Group.hs b/src/Propellor/Property/Group.hs index 58e49a86..f47867c1 100644 --- a/src/Propellor/Property/Group.hs +++ b/src/Propellor/Property/Group.hs @@ -1,6 +1,7 @@ module Propellor.Property.Group where import Propellor.Base +import Propellor.Property.User (hasGroup) type GID = Int @@ -12,3 +13,6 @@ exists (Group group') mgid = check test (cmdProperty "addgroup" (args mgid)) test = not . elem group' . words <$> readProcess "cut" ["-d:", "-f1", groupFile] args Nothing = [group'] args (Just gid) = ["--gid", show gid, group'] + +hasUser :: Group -> User -> Property DebianLike +hasUser = flip hasGroup |
