summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2015-01-19 14:43:25 -0400
committerJoey Hess2015-01-19 14:43:25 -0400
commit04d4d0d6c43dcf7643417bb16927f314b55e42fc (patch)
tree173994dd6be01ae350bd995f5fd1f0ac629adef1 /src/Propellor
parent4da4c4a70feeb9f11f9e521a45fb51d16082802a (diff)
Fix info propigation from fallback combinator's second Property.
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs
index 43690735..9db08b2d 100644
--- a/src/Propellor/Property.hs
+++ b/src/Propellor/Property.hs
@@ -92,11 +92,13 @@ check c p = adjustProperty p $ \satisfy -> ifM (liftIO c)
-- | Tries the first property, but if it fails to work, instead uses
-- the second.
fallback :: Property -> Property -> Property
-fallback p1 p2 = adjustProperty p1 $ \satisfy -> do
- r <- satisfy
- if r == FailedChange
- then propertySatisfy p2
- else return r
+fallback p1 p2 = p1' { propertyChildren = p2 : propertyChildren p1' }
+ where
+ p1' = adjustProperty p1 $ \satisfy -> do
+ r <- satisfy
+ if r == FailedChange
+ then propertySatisfy p2
+ else return r
-- | Marks a Property as trivial. It can only return FailedChange or
-- NoChange.