summaryrefslogtreecommitdiff
path: root/src/Propellor/Property.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Property.hs')
-rw-r--r--src/Propellor/Property.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 8c0a5859..54dd8908 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -303,7 +303,8 @@ pickOS a b = c `addChildren` [toChildProperty a, toChildProperty b]
where
-- This use of getSatisfy is safe, because both a and b
-- are added as children, so their info will propigate.
- c = withOS (getDesc a) $ \_ o ->
+ c = property (getDesc a) $ do
+ o <- getOS
if matching o a
then maybe (pure NoChange) id (getSatisfy a)
else if matching o b
@@ -330,15 +331,9 @@ pickOS a b = c `addChildren` [toChildProperty a, toChildProperty b]
withOS
:: (SingI metatypes)
=> Desc
- -> (OuterMetaTypesWitness '[] -> Maybe System -> Propellor Result)
+ -> (OuterMetaTypesWitness metatypes -> Maybe System -> Propellor Result)
-> Property (MetaTypes metatypes)
-withOS desc a = property desc $ a dummyoutermetatypes =<< getOS
- where
- -- Using this dummy value allows ensureProperty to be used
- -- even though the inner property probably doesn't target everything
- -- that the outer withOS property targets.
- dummyoutermetatypes :: OuterMetaTypesWitness ('[])
- dummyoutermetatypes = OuterMetaTypesWitness sing
+withOS desc a = property' desc $ \w -> a w =<< getOS
-- | A property that always fails with an unsupported OS error.
unsupportedOS :: Property UnixLike