From 04d4d0d6c43dcf7643417bb16927f314b55e42fc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Jan 2015 14:43:25 -0400 Subject: Fix info propigation from fallback combinator's second Property. --- debian/changelog | 1 + src/Propellor/Property.hs | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index c458de81..b9d1373e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ propellor (1.4.0) UNRELEASED; urgency=medium * Properties now form a tree, instead of the flat list used before. This includes the properties used inside a container. (API change) + * Fix info propigation from fallback combinator's second Property. -- Joey Hess Thu, 15 Jan 2015 20:14:29 -0400 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. -- cgit v1.2.3