summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Debootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2014-12-08 01:12:55 -0400
committerJoey Hess2014-12-08 01:12:55 -0400
commit06975ec5e1b9e7d6018074aad55aa8b56cd64aba (patch)
tree2cc2264dc760d96207491f94b173f2668d6fe6f0 /src/Propellor/Property/Debootstrap.hs
parent6b6d5a08819e946364a41dfa67d6c26a51479420 (diff)
another place to use toResult
Diffstat (limited to 'src/Propellor/Property/Debootstrap.hs')
-rw-r--r--src/Propellor/Property/Debootstrap.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index 0181d58a..0a7308ff 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -148,18 +148,16 @@ sourceInstall = property "debootstrap installed from source" (liftIO sourceInsta
`requires` arInstalled
perlInstalled :: Property
-perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $ do
- v <- liftIO $ firstM id
+perlInstalled = check (not <$> inPath "perl") $ property "perl installed" $
+ liftIO $ toResult . isJust <$> firstM id
[ yumInstall "perl"
]
- if isJust v then return MadeChange else return FailedChange
arInstalled :: Property
-arInstalled = check (not <$> inPath "ar") $ property "ar installed" $ do
- v <- liftIO $ firstM id
+arInstalled = check (not <$> inPath "ar") $ property "ar installed" $
+ liftIO $ toResult . isJust <$> firstM id
[ yumInstall "binutils"
]
- if isJust v then return MadeChange else return FailedChange
yumInstall :: String -> IO Bool
yumInstall p = boolSystem "yum" [Param "-y", Param "install", Param p]